Jsp
Servlet
ServletContainer


Name:
Jsp

Description:
Parse, compile and execute a JSP page. You can find more informations about JSP and Servlets here
http://java.sun.com/.

Options:
Option Default Values Short Description Example(s)
JavaCompiler "javac" Quoted string Optional command line for the java compiler "/usr/local/jdk1.3.1/bin/javac"
ClassPath - Quoted string Optional classpath set for the java compiler "Pi3Servlet.jar;servlet.jar"
Context + Valid Pi3 object Reference Reference to servlet container ServletContainer
Extends - Quoted string Valid base class used by this Jsp. "Pi3HttpJspPage"
Init - Quoted string Servlet config option(s) "color=red"
Encoding - Quoted string Encoding of the java source files "UTF8"
OutputPath - Quoted string Valid path name, where the compiled Jsp source files (.class) will be stored "c:\Program Files\jdk1.3.1\jre\lib"
SourcePath - Quoted string Valid path name, where the Jsp source files (.java) will be stored "..\Jsp"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

Context, Init
This options are the same as used for the class Servlet.
JavaCompiler
The java compiler will be invoked on POSIX systems by this command line. On Windows, the sun.tools.javac.Main interface is used.
ClassPath
The java compiler will use this as the class path, if set, when a Jsp source is compiled.
Extends
This parameter is a valid class name, to be used as the base class of a Jsp by the Jsp parser. This value is optional and needs to be overwritten only in special cases.
Encoding
This optional parameter sets the encoding of the .java files for the javac compiler. The default value is UTF8.
OutputPath
The java compiler needs a valid path name, where the compiled Jsp source files (.class) will be stored. This path must be part of the CLASSPATH.
SourcePath
The built in JSP parser will write the output Jsp source files (.java) into this folder. The java compiler looks for this source files in this folder.

Phase:
HANDLE

Returns:
PIAPI_COMPLETED, PIAPI_ERROR or INT_REDIRECT according to the result of JNI calls and the status returned by the servlet.

Note:

Example:

	<Object>
		Name Jsp
		Class JspClass
		Context ServletContainer
	</Object>

	<Object>
		...
		Handle Condition="&cmp(&dblookup(response,string,ObjectMap,SERVLET),Servlet)" Jsp
		...
	</Object>
	

:


Name:
Servlet

Description:
Load and execute a java servlet extension. You can find more informations about servlets here
http://java.sun.com/.

Options:
Option Default Values Short Description Example(s)
Context + Valid Pi3 object Reference Reference to servlet container ServletContainer
ClassName - Quoted string Valid Servlet class name "org.pi3.servlet.samples.HelloServlet"
ServletName - Quoted string Any name for Servlet "My 1st Servlet"
Init - Quoted string Servlet config option(s) "color=red"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

Context
The reference to the Servlet container must exist. In Pi3Web 2.0 it is only allowed to refer to one singleton servlet container.
ClassName
The class name of the Servlet to run. The class must exist within CLASSPATH and must be a child class of Servlet. The class could implement the interface SingleThreadModel.
ServletName
Optional name of the Servlet for human reading. This feature is for use with future versions and is ignored in Servlet API 2.1.
Init
The value has to be a quoted string of format "key=value". The key and the value are forwarded as ServletConfig parameters to the Servlet on initialization. The possible values are Servlet specific.

Phase:
HANDLE

Returns:
PIAPI_COMPLETED, PIAPI_ERROR or INT_REDIRECT according to the result of JNI calls and the status returned by the servlet.

Note:

Example:

	<Object>
		Name Servlet
		Class ServletClass
		Context ServletContainer
	</Object>

	<Object>
		...
		Handle Condition="&cmp(&dblookup(response,string,ObjectMap,SERVLET),Servlet)" \
			Servlet ClassName="MyServlet"
		...
	</Object>
	

Name:
ServletContainer

Description:
The ServletContainer is the Pi3 object, which contains the ServletContext within the JVM. It also maintains the HttpSessions, the Servlet instances including their ServletConfig and the default JspFactory. In Pi3Web 2.0 only one ServletContainer could exist. Thus, only one JVM could serve Servlet requests.

Options:

Overview
Option Default Values Short Description Example(s)
JvmNumber - Any number Number of JVMs 1
JvmOption - Quoted string JVM startup option(s) "-Djava.compiler=NONE"
JvmLocalReferences - Any number Number of local references 128
JvmIgnoreUnrecognized - Empty string Ignore invalid JVM options ""
LogFile - Valid filename Servlet log file "../Logs/servlet.log"
Expression - Valid Pi3Expression Expression in log messages "[$t|$P|$k|$T] "
OpenMode - Either "a" or "c" Mode to open log file "a"
DocBase - Valid path Document root for web application ".\WebRoot2"
- in the default indicates no default
+ in the default indicates the field is mandatory

Description of Options

JvmNumber
The number of JVMs for this ServletContainer. Only 1 is valid in Pi3Web 2.0.
JvmOption
The value has to be a quoted string of format "key=value". The key and the value are forwarded as configuration options to the JVM on startup. For possible values refer to the JDK documentation. JvmOption could be set multiple times for a list of options.
JvmLocalReferences
The number of local references maintained by the JVM. For possible values refer to the JDK documentation. The default value is 16. To less local references will be complained by the JVM in console messages.
JvmIgnoreUnrecognized
If set, invalid options will be ignored by the JVM. If not set, the JVM will complain unknown or invalid options. If JvmIgnoreUnrecognized is set, the empty string value must be there.
LogFile
If set, all Servlet log messages will be written to the given file. If not set, logging will be disabled.
Expression
If set, the Expression will be evaluated and written in front of any log message. This will only take place, if an Http object is available, thus only valid at request time but not at startup or shutdown time.
OpenMode
The file mode for opening the log file. If "a", new log messages will be appended to the log. If "c" is set, a new logfile will be created each time the server will be restarted.
DocBase
The value will be used to physical resolve a URL path by the ServletContext. So a web application stores all resources within the document base (the web root of the application). This is also a security feature of the Servlet API.

Phase:
Server startup and shutdown

Returns:
PIAPI_COMPLETED, PIAPI_ERROR

Note:

Example:

	<Object>
		Name ServletContainer
		Class ServletContainerClass
		JvmNumber 1
		JvmOption "-Djava.compiler=NONE"
		JvmOption "-verbose:jni"
		JvmOption "-Djava.class.path=servlet.jar;Pi3Servlet.jar"
		JvmOption "-Djava.library.path=."
		JvmLocalReferences 128
		JvmIgnoreUnrecognized ""
		LogFile "../Logs/servlet.log"
		Expression "[$t|$P|$k|$T] "
		OpenMode "a"
		DocBase ".\WebRoot2"
	</Object>
	

: