The sun-web.xml visual editor lets you edit the platform-specific web deployment descriptor for Sun Java System Application Server. You open the visual editor by expanding your project's Configuration Files node in the Projects window and double-clicking the sun-web.xml file. A web application only contains a sun-web.xml deployment descriptor if its target server is the Sun Java System Application Server.
The Session tab of the editor helps you configure the persistence type and the session properties for a web application session. The session properties are grouped under the following categories:
Select the persistence type from the pull-down list. This table describes the persistence types supported by Application Server.
Type | Description |
---|---|
Memory |
Use this persistence type to store session data in the system's memory. |
File |
Use this persistence type to store session data in a file. If the instance becomes unavailable and restarts, it can recover the session information that was last written to the files. |
The Manager Properties help you configure how sessions are created and destroyed,
where session state is stored, and the maximum number of sessions.
Name | Description |
---|---|
reapIntervalSeconds | The number of seconds after which Application Server will check for expired sessions. This is also the interval at which sessions are passivated if maxSessions is exceeded. |
maxSessions | The maximum number of active sessions. If there is no limit on the number of active sessions, type -1. The session manager passivates sessions to the persistent store when this maximum number is reached. This property is applicable only if the Persistence Type is File. |
sessionFilename | The absolute or relative pathname of the file in which the session state is preserved between application restarts, if preserving the state is possible. A relative pathname is relative to the temporary directory for this web module. |
The Store Properties control how the sessions are stored in the Application
Server.
Name | Value |
---|---|
directory | The absolute or relative pathname of the directory into which individual session files are written. A relative path is relative to the temporary work directory for this web module. This property is applicable only if the Persistence Type is File. |
The Session Properties help you configure how the sessions behave in the Application
Server.
Name | Value |
---|---|
timeoutSeconds | The default maximum inactive interval, in seconds, for all sessions created in this web module. If set to 0 or less, sessions, this web module never expires. The value of session-timeout element in the web.xml overrides this value. |
enableCookies | If this property is set to true, cookies are used for session tracking. |
enableURLRewriting | If this property is set to true, URL rewriting is enabled. This provides session tracking via URL rewriting when the browser does not accept cookies. You must also use an encodeURL or encodeRedirectURL call in the servlet or JSP. |
idLengthBytes | The number of bytes in this web module’s session ID. |
The Cookie Properties specify the cookies generated by the Application Server. The following table lists the session cookie properties.
Name | Value |
---|---|
cookiePath | The pathname that is set when the cookie is created. The browser sends the cookie if the pathname for the request contains this pathname. If set to / (slash), the browser sends cookies to all URLs served by the Application Server. You can set the path to a narrower mapping to limit the request URLs to which the browser sends cookies. |
cookieMaxAgeSeconds | The expiration time, in seconds, after which the browser expires the cookie. |
cookieDomain | The domain for which the cookie is valid. |
cookieComment | The comment that identifies the session tracking cookie in the cookie file. Applications can provide a more specific comment for the cookie. |