Chapter 4. JBoss Web

The most common technologies for creating Java web applications are JSPs and servlets, the standard Java EE web component technologies. To allow deployment of JSPs and servlets, JBoss comes with the JBoss Web container. JBoss Web represents the web tier of JBoss Enterprise Application Platform, and provides the servlet container and HTTP web server based on Apache Tomcat for the deployment of JSPs and servlets.
JBoss Web supports the Apache Portable Runtime (APR) library, which allows use of native connectors such as mod_jk, mod_cluster, and mod_proxy.

4.1. System Properties

The following system properties modify the JBoss Web server behavior:

General Properties

catalina.useNaming
override for the useNaming element of the Context element
Set to false to override the useNaming attribute of all Context elements.
catalina.config
URL of the catalina.properties configuration file
jvmRoute
used if an Engine element does not define its jvmRoute attribute
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES
activation or deactivation of clearing static or final fields from loaded classes (set to true by default)
Set to true to null out static or final fields from the loaded classes when a web application is stopped. This setting provides a workaround for garbage collection bugs and application coding errors.
org.apache.tomcat.util.buf.StringCache.byte.enabled
enabling the String cache for ByteChunk (set to false by default)
Set to true to enable the String cache for ByteChunk.
org.apache.tomcat.util.buf.StringCache.char.enabled
enabling the String cache for CharChunk (set to false by default)
Set to true to enable the String cache for CharChunk.
org.apache.tomcat.util.buf.StringCache.trainThreshold
call limit for the String cache activation (set to 2000 by default)
The limit defines the number of times the toString() method must be called before the String cache is activated.
org.apache.tomcat.util.buf.StringCache.cacheSize
size of the String cache (set to 200 entries by default)
org.apache.tomcat.util.buf.StringCache.maxStringSize
maximum length of a cached String (set to 128 characters by default)
org.apache.tomcat.util.http.FastHttpDateFormat.CACHE_SIZE
size of the cache used for parsing and formatting of date values (2000 entries by default)
org.apache.catalina.core.StandardService.DELAY_CONNECTOR_STARTUP
disabling automatic connector start-up (To prevent the connector from starting up automatically, set to true.)
org.apache.catalina.connector.Request.SESSION_ID_CHECK
enabling session verification (If enabled, that is set to true, the Servlet container verifies if a session with the specified session ID exists in a context before creating a session with that ID.)
org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER
enabling custom HTTP status messages in HTTP headers (If enabled, that is set to true, custom HTTP status messages are allowed in HTTP headers.)

Important

Ensure that any such message uses only the ISO-8859-1 characters to prevent a possible XSS vulnerability. The property is set to false by default.
org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH
activates automatic usage of v1 cookies (set to true by default)
The v1 cookies are used automatically if the servlet container is using v0 cookies and cookie values which have to be quoted to be valid.
org.apache.el.parser.COERCE_TO_ZERO
sets if "" and null numbers become 0
This is the desired behavior defined in the specification and therefore the property is set to true by default.

JSP Configuration Properties

org.apache.jasper.compiler.Generator.VAR_EXPRESSIONFACTORY
the variable used as the expression language expression factory (if unspecified the _el_expressionfactory is used)
org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER
The name of the variable to use for the instance manager factory. If not specified, the default value of _jsp_instancemanager will be used.
org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING
If false the requirements for escaping quotes in JSP attributes will be relaxed so that a missing required quote will not cause an error. If not specified, the specification compliant default of true will be used.
org.apache.jasper.runtime.JspFactoryImpl.USE_POOL
If true, a ThreadLocal PageContext pool will be used. If not specified, the default value of true will be used.
org.apache.jasper.runtime.JspFactoryImpl.POOL_SIZE
The size of the ThreadLocal PageContext. If not specified, the default value of 8 will be used.
org.apache.jasper.Constants.JSP_SERVLET_BASE
The base class of the Servlets generated from the JSPs. If not specified, the default value of org.apache.jasper.runtime.HttpJspBase will be used.
org.apache.jasper.Constants.SERVICE_METHOD_NAME
The name of the service method called by the base class. If not specified, the default value of _jspService will be used.
org.apache.jasper.Constants.SERVLET_CLASSPATH
The name of the ServletContext attribute that provides the classpath for the JSP. If not specified, the default value of org.apache.catalina.jsp_classpath will be used.
org.apache.jasper.Constants.JSP_FILE
The name of the request attribute for <jsp-file> element of a servlet definition. If present on a request, this overrides the value returned by request.getServletPath() to select the JSP page to be executed. If not specified, the default value of org.apache.catalina.jsp_file will be used.
org.apache.jasper.Constants.PRECOMPILE
The name of the query parameter that causes the JSP engine to just pre-generate the servlet but not invoke it. If not specified, the default value of org.apache.catalina.jsp_precompile will be used.
org.apache.jasper.Constants.JSP_PACKAGE_NAME
The default package name for compiled jsp pages. If not specified, the default value of org.apache.jsp will be used.
org.apache.jasper.Constants.TAG_FILE_PACKAGE_NAME
The default package name for tag handlers generated from tag files. If not specified, the default value of org.apache.jsp.tag will be used.
org.apache.jasper.Constants.ALT_DD_ATTR
The servlet context attribute under which the alternate deployment descriptor for this web application is stored. If not specified, the default value of org.apache.catalina.deploy.alt_dd will be used.
org.apache.jasper.Constants.TEMP_VARIABLE_NAME_PREFIX
Prefix to use for generated temporary variable names. If not specified, the default value of _jspx_temp will be used.
org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS
If true, the instance manager is used to obtain tag handler instances. If not specified, false will be used.
org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS
If true, annotations specified in tags will be processed and injected. This can have a performance impact when using simple tags, or if tag pooling is disabled. If not specified, true will be used.

Security Configuration Properties

org.apache.catalina.connector.RECYCLE_FACADES
If this is true or if a security manager is in use a new facade object will be created for each request. If not specified, the default value of false will be used.
org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH
If this is true the '\' character will be permitted as a path delimiter. If not specified, the default value of false will be used.
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH
If this is true '%2F' and '%5C' will be permitted as path delimiters. If not specified, the default value of false will be used.

Properties Required by Specification

org.apache.catalina.STRICT_SERVLET_COMPLIANCE
If set to true, then the following applies:
  • any wrapped request or response object passed to an application dispatcher is checked to ensure that it has wrapped the original request or response. (SRV.8.2 / SRV.14.2.5.1)
  • a call to Response.getWriter() if no character encoding has been specified will result in subsequent calls to Response.getCharacterEncoding() returning ISO-8859-1 and the Content-Type response header will include a charset=ISO-8859-1 component. (SRV.15.2.22.1)
  • every request that is associated with a session will cause the session's last accessed time to be updated regardless of whether or not the request explicitly accesses the session. (SRV.7.6)
org.apache.catalina.core.StandardWrapperValve.SERVLET_STATS
If true or if org.apache.catalina.STRICT_SERVLET_COMPLIANCE is true, the wrapper will collect the JSR-77 statistics for individual servlets. If not specified, the default value of false will be used.
org.apache.catalina.session.StandardSession.ACTIVITY_CHECK
If this is true or if org.apache.catalina.STRICT_SERVLET_COMPLIANCE is true Tomcat will track the number of active requests for each session. When determining if a session is valid, any session with at least one active request will always be considered valid. If not specified, the default value of false will be used.

4.1.1. Modifying System Properties

You can modify the system properties either in the JBOSS_HOME/bin/run.conf or in the form of a -D option on server start-up (refer to the Getting Started Guide).