This section describes the XML elements in the default-web.xml file.
Table A–2 default-web.xml Elements
Element |
Default |
Description |
---|---|---|
checkInterval |
0 |
The checkInterval is the time in seconds between checks to see if a JSP file needs to be recompiled. If the development element is false and checkInterval is greater than zero it means the back ground compilations are enabled. |
compiler |
javac |
Specifies the compiler Ant uses to compile JSP files. See the Ant documentation at http://antinstaller.sourceforge.net for more information. If the value is set to jdt, the Eclipse JDT Java compiler is used instead of Ant. |
compilerSourceVM |
Allows source compatibility with the specified JDK release. |
|
compilerTargetVM |
true |
Generates class files for the specified VM version |
classdebuginfo |
true |
The JSP page gets compiled with debug information. |
classpath |
created dynamically based on the current web application |
classpath is generated dynamically based on the current web application. |
development |
true |
By default, JSP pages are recompiled since the request. The modifications are specified through the modificationTestInterval parameter. If false, checkInterval is enabled. |
dumpSmap |
false |
If set to true, dumps SMAP information for JSR 45 debugging to a file. Set to false if suppressSmap is true |
enablePooling |
true |
Determines whether the tag handler pooling is enabled. |
errorOnUserBeanInvalidClassAttribute |
false |
If set to true, issues an error when the value of the class attribute in a useBean action is not a valid bean class. |
fork |
true |
fork compiles JSP pages with a separate JVM process. |
genStrCharArray |
false |
If set to true, generates text strings as char arrays, which improves performance in some cases. |
httpMethods |
ALL METHODS |
Comma separated list of HTTP methods are supported by JSP/Servlet. Wildcard (*) denotes all methods. |
ieClassId |
clsid:8AD9C840- 044E-11D1-B3E9- 00805F499D93 |
Default value is sent to Internet Explorer when using the <jsp:plugin> tags. |
initialCapacity |
32 |
Initial capacity of HashMap mapping JSPs to their corresponding servlets. |
initial-capacity |
Same as initialCapacity. If both are specified, initialCapacity takes the precedence |
|
javeEncoding |
UTF – 8 |
This element does the character encoding for Java files, |
javaCompilerPlugin |
The fully qualified class name of the JSP compiler plug-in. |
|
keepgenerated |
true |
By default, the generated Java files are kept in the subdirectory after compilation. |
modificationTestInterval |
0 |
JSP files can only be modified during the specified time interval mentioned in seconds. By Default, value allows to modify JSP files in development mode without time constraint. |
mappedfile |
true |
By default, the static content in a JSP page result in one print statement. |
reload-interval |
0 |
Specifies the frequency at which JSP files are checked for modifications. The frequency value is in seconds. If the value is 0 JSP pages are checked for modifications. —1 disables the checks for JSP page. |
scratchdir |
Work directory for the application |
The Java and class files are stored in this directory. |
suppressSmap |
false |
If set to true, generation of SMAP information for JSR 45 debugging is suppressed. |
trimSpaces |
false |
If set to true, trims white spaces in template text between actions or directives. |
usePrecompiled |
false |
If true, JSP files are precompiled and their corresponding servlet classes have been bundled in the web applications's WEB-INF/lib or WEB-INF/classes. When JSP is accessed, it is not compiled and instead precompiled servlet class is used. |
use-precompiled |
false |
Same as usePrecompiled. If both are specified, usePrecompiled takes the precedence. |
You can configure Web Server to use the Eclipse JDT Java compiler instead of Ant and another Java compiler.
Download jasper-jdt-6.0.26.jar from tomcat 6.0.26.
This jar file is available from the tomcat maven repository at http://tomcat.apache.org/dev/dist/m2-repository/org/apache/tomcat/jasper-jdt/6.0.26/
Add the jar file to the class-path-suffix in server.xml
For example:
<jvm> ... <class-path-suffix>/tmp/jasper-jdt-6.0.26.jar</class-path-suffix> ... </jvm>
Set the compiler to jdt for the JSP servlet in default-web.xml.
For example:
<servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> ... <init-param> <param-name>compiler</param-name> <param-value>jdt</param-value> </init-param> ... </servlet>