Configuration
Æjaks needs two parameters in order to run an application:
- AEJAKS_LIB_PATH - the path to the directory of script(s).
-
AEJAKS_SCRIPT_NAME - specific script to run for the application.
In addition, three other parameters can be specified for other behaviors:
- AEJAKS_SYSTEM_ENCODING - specifies the character encoding of the script(s).
- AEJAKS_DEBUG - causes massive amounts of debugging messages to print.
-
TCLLIBPATH - used by the Jacl interpreter to find other Tcl library packages.
There are several ways in which to specify these values. The first value found for each variable is used.
- AEJAKS_LIB_PATH
-
System property
specified when starting the servlet container:
java -DAEJAKS_LIB_PATH=/my/app_dir -jar jetty/start.jar
-
web.xml
embedded in the aejaks.war (or other .war) file. If specifed in web.xml, it must be a context-param:<context-param> <param-name>AEJAKS_LIB_PATH</param-name> <param-value>/home/apps</param-value> </context-param>
AEJAKS_LIB_PATH may point to either a directory in the file system, or resource directory on the CLASSPATH. When AEJAKS_LIB_PATH refers to a file system directory, the path name should begin with / or ./ to indicate absolute or relative paths, respectively. When a resource is specified, the pathname should begin with resource:/. In this case, the application script will typically be included in the aejaks.war file. For example, if AEJAKS_LIB_PATH is defined as resource:/app, then a directory should be created in the war file as WEB-INF/classes/app. Application scripts should be placed in that directory.
- AEJAKS_SCRIPT_NAME
-
URL request parameter AEJAKS_SCRIPT_NAME
specified on the URL that points to the application context. AEJAKS_SCRIPT_NAME='*' must have been set as a System property or web.xml parameter:
http://www.myserver.foo/aejaks/app?AEJAKS_SCRIPT_NAME=order.tcl
-
System property
specified when starting the servlet container. If using the URL request parameter to specifiy a script name, set the value as *:
java -DAEJAKS_SCRIPT_NAME=cool_app.tcl -jar jetty/start.jar
java -DAEJAKS_SCRIPT_NAME='*' -jar jetty/start.jar
-
web.xml
embedded in the aejaks.war (or other .war) file. If using the URL request parameter to specifiy a script name, set the value as *. Note that this parameter is an init-param child element of the servlet element.<servlet> <servlet-name>Aejaks</servlet-name> <servlet-class>org.aejaks.servlet.AejaksServlet</servlet-class> <init-param> <param-name>AEJAKS_SCRIPT_NAME</param-name> <param-value>awesome_app.tcl</param-value> </init-param> </servlet>
-
Default is Servlet name (from the web.xml file), plus ".tcl" extension.
If the servlet name in the web.xml file is OrderApp, then the script to invoke will be OrderApp.tcl.
- AEJAKS_SYSTEM_ENCODING
-
System property
specified when starting the servlet container:
java -DAEJAKS_SYSTEM_ENCODING=utf-8 -jar jetty/start.jar
-
web.xml
embedded in the aejaks.war (or other .war) file. If specifed in web.xml, it must be a context-param:<context-param> <param-name>AEJAKS_SYSTEM_ENCODING</param-name> <param-value>utf-8</param-value> </context-param>
AEJAKS_SYSTEM_ENCODING is used to specify a character encoding for the Tcl scripts. Particularly useful for Asian and other languages when string literals in scripts are not escaped.
-
AEJAKS_DEBUG
If this parameter is set to any value, copious amounts of trivial debugging information will be printed on console stdout where the servlet was stared.
This parameter can only be set as a system property:
java -DAEJAKS_DEBUG=yes -jar jetty/start.jar
-
TCLLIBPATH
TCLLIBPATH is used by the Jacl interpreter to find other Tcl library packages that may be used. Unlike other PATH-type environment variables, TCLLIBPATH is space separated.
This parameter can only be set as a system property:
java -DTCLLIBPATH=/opt/tcl/lib -jar jetty/start.jar