BEA Logo BEA WebLogic Server Release 6.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   Developing WebLogic Server Applications:   Previous topic   |   Next topic   |   Contents   

 

weblogic.xml Deployment Descriptor Elements

 

This following sections describe the deployment descriptor elements defined in the weblogic.xml file. The root element for weblogic.xml is <weblogic-web-app>. The following elements are defined within the <weblogic-web-app> element:

You can also access the Document Type Descriptor (DTD) for weblogic.xml at http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd.

description Element

The description element is a text description of the Web Application.

weblogic-version Element

The weblogic-version element indicates the version of WebLogic Server on which this Web Application is intended to be deployed. This element is informational only and is not used by WebLogic Server.

security-role-assignment Element

The security-role-assignment element declares a mapping between a security role and one or more principals in the realm, as shown in the following example.

<security-role-assignment>
     <role-name>PayrollAdmin</role-name>
     <principal-name>Tanya</principal-name>
     <principal-name>Fred</principal-name>
     <principal-name>system</principal-name>
</security-role-assignment>

The following table describes the elements you can define within a security-role-assignment element.

Element

Required
Optional

Description

<role-name>

Required

Specifies the name of a security role.

<principal-name>

Required

Specifies the name of a principal that is defined in the security realm. You can use multiple <principal-name> elements to map principals to a role. For more information on security realms, see the Programming WebLogic Security.

reference-descriptor Element

The reference-descriptor element maps the JNDI name of a server resource to a name used in the Web Application. The reference-description element contains two elements: The resource-description element maps a resource, for example, a DataSource, to its JNDI name. The ejb-reference element maps an EJB to its JNDI name.

resource-description Element

The following table describes the elements you can define within a resource-description element

Element

Required/
Optional

Description

<res-ref-name>

Required

Specifies the name of a resource reference.

<jndi-name>

Required

Specifies a JNDI name for the resource.

.

ejb-reference-description Element

The following table describes the elements you can define within a ejb-reference-description element

Element

Required/
Optional

Description

<ejb-ref-name>

Required

Specifies the name of an EJB reference used in your Web Application.

<jndi-name>

Required

Specifies a JNDI name for the reference.

.

session-descriptor Element

The session-descriptor element defines parameters for HTTP sessions, as shown in the following example:

<session-descriptor>
  <session-param>
     <param-name>
       CookieDomain
     </param-name>
     <param-value>
       myCookieDomain
     </param-value>
  </session-param>
</session-descriptor>

Session Parameter Names and Values

The following table describes the valid session parameter names and values you can define within a session-param element:

Parameter Name

Default Value

Parameter Value

CookieDomain

Null

Identifies the server to which the browser sends cookie information when the browser makes a request. For example, setting the CookieDomain to .mydomain.com returns cookies to any server in the *.mydomain.com domain.

The domain name must have at least two components; setting a name to *.com or *.net is invalid.

If unset, this parameter defaults to the server that issued the cookie.

CookieComment

Weblogic Server Session Tracking Cookie

Specifies the comment that identifies the session tracking cookie in the cookie file.

If unset, this parameter defaults to WebLogic Session Tracking Cookie. You may provide a more specific name for your application.

CookieMaxAgeSecs

-1

Sets the life span of the session cookie, in seconds, after which it expires on the client.

If the value is 0, the cookie expires immediately.

The maximum value is MAX_VALUE, where the cookie lasts forever.

If set to -1, the cookie expires when the user exits the browser.

For more information about cookies, see Setting up Session Management

CookieName

JSESSIONID

Defines the session cookie name. Defaults to JSESSIONID if unset. You may set this to a more specific name for your application.

CookiePath

Null

Specifies the pathname to which the browser sends cookies.

If unset, this parameter defaults to / (slash), where the browser sends cookies to all URLs served by WebLogic Server. You may set the path to a narrower mapping, to limit the request URLs to which the browser sends cookies.

CookiesEnabled

True

Use of session cookies is enabled by default and is recommended, but you can disable them by setting this property to false. You might turn this option off to test URL re-writing on your site.

InvalidationIntervalSecs

60

Sets the time, in seconds, that WebLogic Server waits between doing house-cleaning checks for timed-out and invalid sessions, and deleting the old sessions and freeing up memory. Use this parameter to tune WebLogic Server for best performance on high traffic sites.

The minimum value is every second (1). The maximum value is once a week (604,800 seconds). If unset, the parameter defaults to 60 seconds.

PersistentStoreDir

session_db

If you have set PersistentStoreType to file, this parameter sets the directory path where WebLogic Server will store the sessions. The directory path is either relative to the temp directory or an absolute path. The temp directory is either a generated directory under the WEB-INF directory of the Web Application, or a directory specified by the context-param javax.servlet.context.tmpdir.

Ensure that you have enough disk space to store the number of valid sessions multiplied by the size of each session. You can find the size of a session by looking at the files created in the PersistentStoreDir.

You can make file-persistent sessions clusterable by making this directory a shared directory among different servers.

You must create this directory manually.

PersistentStorePool

None

Specifies the name of a JDBC connection pool to be used for persistence storage.

For more details on setting up a database connection pool, see Managing JDBC Connectivity.

PersistentStoreType

memory

Sets the persistent store method to one of the following options:

  • memory-disables persistent session storage

  • file-uses file-based persistence (See also PersistentStoreDir, above)

  • jdbc-uses a database to store persistent sessions. (see also PersistentStorePool, above)

  • replicated-same as memory, but session data is replicated across the clustered servers

SwapIntervalSecs

10

Sets the time, in seconds, that WebLogic Server waits between purging the least recently-used sessions from the cache to the persistent store, when the cacheEntries limit has been reached.

If unset, this property defaults to 10 seconds; minimum is 1 second, and maximum is 604800 (1 week).

IDLength

52

Sets the size of the session ID.

The minimum value is 8 bytes and the maximum value is Integer.MAX_VALUE.

If you are writing a WAP application, you must use URL rewriting because the WAP protocol does not support cookies. Also, some WAP devices have a 128-character limit on URL length (including parameters), which limits the amount of data that can be transmitted using URL re-writing. To allow more space for parameters, use this parameter to limit the size of the session ID that is randomly generated by WebLogic Server

CacheSize

1024

The number of sessions that may be active at one time.

TimeoutSecs

3600

Sets the time, in seconds, that WebLogic Server waits before timing out a session, where x is the number of seconds between a session's activity.

Minimum value is 1, default is 3600, and maximum value is integer MAX_VALUE.

On busy sites, you can tune your application by adjusting the timeout of sessions. While you want to give a browser client every opportunity to finish a session, you do not want to tie up the server needlessly if the user has left the site or otherwise abandoned the session.

This parameter can be overridden by the session-timeout element (defined in minutes) in web.xml. For more information, see session-config Element.

JDBConnectionTimeoutSecs

120

Sets the time, in seconds, that WebLogic Server waits before timing out a JDBC connection, where x is the number of seconds between.

URLRewritingEnabled

true

Enables URL rewriting, which encodes the session ID into the URL and provides session tracking if cookies are disabled in the browser.

ConsoleMainAttribute


If you enable Session Monitoring in the WebLogic Server Administration Console, set this parameter to the name of the session parameter you will use to identify each session that is monitored. For more information, see Monitoring a WebLogic Domain.

jsp-descriptor Element

The jsp-descriptor element defines parameter names and values for servlet JSPs, as shown in the following example.

<jsp-descriptor>
     <jsp-param>
          <param-name>
           FOO
          </param-name>
          <param-value>
           BAR
          </param-value>
     </jsp-param>
</jsp-descriptor>

JSP Parameter Names and Values

The following table describes the parameter names and values you can define within a jsp-param element.

Parameter Name

Default Value

Parameter Value

compileCommand

javac, or the Java compiler defined for a server under the configuration
/tuning tab of the WebLogic Server Administration Console

Specifies the full pathname of the standard Java compiler used to compile the generated JSP servlets. For example, to use the standard Java compiler, specify its location on your system as shown below:

<param-value>
  /jdk130/bin/javac.exe
</param-value>

You can also specify that WebLogic Server precompile JSPs on start up. For more information, see Precompiling JSPs.

compileFlags

None

Passes one or more command-line flags to the compiler. Enclose multiple flags in quotes, separated by a space. For example:

java weblogic.jspc
 -compileFlags "-g -v" myFile.jsp

compilerclass

None

Name of a Java compiler that is executed in WebLogic Servers's virtual machine. (Used in place of an executable compiler such as javac or sj.)

encoding

Default encoding of your platform

Specifies the default character set used in the JSP page. Use standard Java character set names.

If unset, this parameter defaults to the encoding for your platform.

A JSP page directive (included in the JSP code) overrides this setting. For example:

<%@ page contentType="text/html; charset=custom-encoding"%>

keepgenerated

false

Saves the Java files that are generated as an intermediary step in the JSP compilation process. Unless this parameter is set to true, the intermediate Java files are deleted after they are compiled.

noTryBlocks

false

If a JSP file has numerous or deeply nested custom JSP tags and you receive a java.lang.VerifyError exception when compiling, use this flag to allow the JSPs to compile correctly.

packagePrefix

jsp_servlet

Specifies the package into which all JSP pages are compiled.

pageCheckSeconds

1

Sets the interval, in seconds, at which WebLogic Server checks to see if JSP files have changed and need recompiling. Dependencies are also checked and recursively reloaded if changed.

If set to 0, pages are checked on every request. If set to -1, page checking and recompiling is disabled.

verbose

true

When set to true, debugging information is printed out to the browser, the command prompt, and WebLogic Server log file.

workingDir

internally generated directory

The name of a directory where WebLogic Server saves the generated Java and compiled class files for a JSP.

 

Back to Top