sunlabs.brazil.sunlabs
Class ExecTemplate

java.lang.Object
  extended by sunlabs.brazil.template.Template
      extended by sunlabs.brazil.sunlabs.ExecTemplate (view source)
All Implemented Interfaces:
TemplateInterface

public class ExecTemplate
extends Template

template to exec a program, and return its arguments into request properties .

This template processes the <exec ...> tag. The following attributes are supported. ${...} substitutions are preformed before the command is run.

command
The command to run. The environment (and path) are inherited from the server. This is a required parameter.
usesh
There is a bug in "exec" that prevents passing arguments to a command with embedded whitespace. If this flag is present, then the command "/bin/sh -c [command]" is run. This only works on systems where "/bin/sh" may be executed.
prepend
The name prepended to the properties produced by this tag
stdin
The standard input to send to the command (if any)
encoding
The character set encoding to use when converting the stdout and stderr properties. If no encoding attribute is present, the encoding property is used instead. Defaults to the default encoding.
timelimit
If specified, this sets the maximum time (in ms) the process is allowed to run before it is forceably killed.
The following request properties are set as a side effect:
stdout
The standard output produced by the program, converted to a String using the default encoding.
stderr
The standard error output produced by the program, converted to a String using the default encoding.
code
The exit code for the program.
error
The error message, if something went wrong.

Currently, there is no way to set the environment or current directory for the program.


Field Summary
 
Fields inherited from class sunlabs.brazil.template.Template
debug
 
Constructor Summary
ExecTemplate()
           
 
Method Summary
 void tag_exec(RewriteContext hr)
           
 
Methods inherited from class sunlabs.brazil.template.Template
done, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecTemplate

public ExecTemplate()
Method Detail

tag_exec

public void tag_exec(RewriteContext hr)

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.