Sun Java System Web Server 7.0 Update 5 Developer's Guide to Java Web Applications

General Elements

General elements are as follows:

sun-web-app Element

This element Web Server- specific configuration for a web application. This element is the root element. The sun-web.xml file contain only one sun-web-app.

Subelements

The following table describes subelements for the sun-web-app element.

Table A–3 sun-web-app Subelements

Element 

Required 

Description 

context-root Element

zero or more 

Contains the web context roots for the web application 

servlet Element

zero or more 

Specifies a principal name for a servlet, which is used for the run-as role defined in web.xml

session-config Element

zero or one 

Specifies the session manager, session cookie, and other session-related information 

resource-env-ref Element

zero or more 

Maps the absolute JNDI name to the resource-env-ref in the corresponding Java EE XML file

resource-ref Element

zero or more 

Maps the absolute JNDI name to the resource-ref in the corresponding Java EE XML file

service-ref Element

zero or more 

Specifies runtime settings for a web service reference 

cache Element

zero or one 

Configures caching for web application components 

class-loader Element

zero or one 

Specifies classloader configuration information 

jsp-config Element

zero or one 

Specifies JSP configuration information 

locale-charset-info Element

zero or one 

Specifies internationalization settings 

property Element

zero or more 

Specifies a property, which has a name and a value 

message-destination-name Element

zero or more 

Specifies a logical message destination 

webservice-description Element

zero or more 

Specifies a web service description 

Attributes

none

Properties

The following table describes the properties for the sun-web-app element.

Table A–4 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.

encodeCookies

true

If true, Web Server URL encodes cookies before sending them to the client. If you don’t want cookies to be encoded, add the following setting to sun-web.xmldirectly under the <sun-web-app> tag:

<property name="encodeCookies" value="false"/>

Do not embed this setting in any other tag. 

tempdir

instance_dir/generated/

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 not to reuse session IDs. Instead, applications 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 HttpResponse.sendRedirect() API (that is, it suppresses the container from translating a relative URL to a fully qualified URL).

context-root Element

This element contains the web context root of the application or web applications. This overrides the corresponding element in the web.xml file.

Subelements

none

Attributes

none

property Element

Specifies a property that has a name and a value. A property adds configuration information to its parent element that is:

For example, a manager-properties element can include property subelements:

<manager-properties>
        <property name="reapIntervalSeconds" value="20" />
     </manager-properties>

The properties that manager-properties element uses depends on the value of the parent session-manager element persistence-type attribute. For details, see the description of the session-manager element.

Subelement

The following table describes subelement for the property element.

Table A–5 property Subelement

Element 

Required 

Description 

description Element

zero or one 

Contains a text description of this element. 

Attributes

The following table describes attributes for the property element.

Table A–6 property Attributes

Attribute 

Default 

Description 

name

none 

Specifies the name of the property or variable 

value

none 

Specifies the value of the property or variable 

description Element

This element contains a text description of the parent element.

Subelements

none

Attributes

none