Defines Sun Java System Web Server-specific configuration for a web application. This is the root element; there can only be one sun-web-app element in a sun-web.xml file.
The following table describes subelements for the sun-web-app element. The left column lists the subelement name, the middle column indicates the requirement rule, and the right column describes what the element does.
Table 6–5 sun-web-app Subelements
Element |
Required |
Description |
---|---|---|
sun-web-appsun-web-app |
zero or more |
Maps roles to users or groups in the currently active realm. |
servletservlet |
zero or more |
Specifies a principal name for a servlet, which is used for the run-as role defined in web.xml. |
zero or one |
Specifies session manager, session cookie, and other session-related information. |
|
zero or more |
Maps the absolute JNDI name to the resource-env-ref in the corresponding J2SE XML file. |
|
zero or more |
Maps the absolute JNDI name to the resource-ref in the corresponding J2SE XML file. |
|
zero or one |
Configures caching for web application components. |
|
zero or one |
Specifies classloader configuration information. |
|
zero or one |
Specifies JSP configuration information. |
|
zero or one |
Specifies internationalization settings. |
|
propertyproperty |
zero or more |
Specifies a property, which contains a name and a value. |
none
The following table describes properties for the sun-web-app element. The left column lists the property name, the middle column indicates the default value, and the right column describes what the property does.
Table 6–6 sun-web-app Properties
Property Name |
Default Value |
Description |
---|---|---|
crossContextAllowed |
true |
If true, allows this web application to access the contexts of other web applications using the ServletContext.getContext() method. |
true |
If true, Sun Java System Web Server URL encodes cookies before sending them to the client. If you do not want cookies to be encoded, add the following to sun-web.xml: <property name="encodeCookies" value="false"> For the above example, enter the line directly under the <sun-web-app> tag; do not embed this in any other tag. |
|
tempdir |
instance_dir/ClassCache/vs_id/uri |
Specifies a temporary directory for use by this web application. This value is used to construct the value of the javax.servlet.context.tempdir context attribute. Compiled JSPs are also placed in this directory. |
singleThreadedServletPoolSize |
5 |
Specifies the maximum number of servlet instances allocated for each SingleThreadModel servlet in the web application. |
reuseSessionID |
false |
If true, this property causes the web application to reuse the JSESSIONID value (if present) in the request header as the session ID when creating sessions. The default behavior of web applications is to not reuse session IDs and instead generate cryptographically random session IDs for new sessions. |
relativeRedirectAllowed |
false |
If true, allows the web application to send a relative URL to the client using the HttpServletResponse.sendRedirect() API (that is, it suppresses the container from translating a relative URL to a fully qualified URL). |