Skip Headers

Oracle Application Server Containers for J2EE Servlet Developer's Guide
10g (9.0.4)

Part Number B10321-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

6
Configuration File Descriptions

This chapter provides detailed descriptions of the elements and attributes of OC4J configuration files for servlets and Web sites. It includes the following sections:


Note:

The detailed discussion in this chapter regarding configuration files and their elements and attributes assumes an OC4J standalone development environment. In an Oracle Application Server environment using Enterprise Manager, configuration is through Application Server Control Web module pages, and many of the files and their properties are invisible to the user. For considerations in configuring and deploying a production application with Enterprise Manager in Oracle Application Server, see Chapter 7, "Configuration with Enterprise Manager".


Configuration for global-web-application.xml and orion-web.xml

The following sections provide detailed information about the global-web-application.xml and orion-web.xml configuration files:

For an overview of these files, see "OC4J and J2EE Web Descriptors".

Element Descriptions for global-web-application.xml and orion-web.xml

This section provides detailed descriptions of the elements and attributes of the global-web-application.xml and orion-web.xml files.

The element descriptions in this section are applicable to either global-web-application.xml or to an application-specific orion-web.xml configuration file. The global-web-application.xml file configures the global application and sets defaults; the orion-web.xml file can override these defaults for a particular application deployment as appropriate.

<orion-web-app ... >

This is the root element for specifying OC4J-specific configuration of a Web application.


Note:

The autoreload-jsp-pages and autoreload-jsp-beans attributes of the <orion-web-app> element are not currently supported by the OC4J JSP container. You can use the JSP main_mode configuration parameter for functionality equivalent to that of autoreload-jsp-pages. See the Oracle Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide for information about this parameter.


Subelements of <orion-web-app>:

<classpath>
<context-param-mapping>
<mime-mappings>
<virtual-directory>
<access-mask>
<cluster-config>
<servlet-chaining>
<request-tracker>
<session-tracking>
<resource-ref-mapping>
<env-entry-mapping>
<security-role-mapping>
<ejb-ref-mapping>
<expiration-setting>
<jazn-web-app>
<web-app-class-loader>
<authenticate-on-dispatch>
<web-app>

Attributes of <orion-web-app>:


Note:

The default-buffer-size attribute does not affect JSP buffer size.



Note:

The OC4J JSP container does not currently support the development flag. It is for servlets only. Use the JSP main_mode flag for similar functionality for JSP pages, as documented in the Oracle Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide. Features of the old Orion JSP container that relate to the development flag do not apply to the OC4J JSP container.



Important:

Use the jsp-taglib-locations attribute only in global-web-application.xml, not in orion-web.xml.



Note:

Processing related to the jsp-print-null, jsp-timeout, jsp-cache-directory, jsp-cache-tlds, jsp-taglib-locations, simple-jsp-mapping, and enable-jsp-dispatcher-shortcut attributes are handled by the OC4J JSP container. For more information about these attributes and related features, see the Oracle Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide.



Note:

The OC4J JSP container does not currently support the persistence-path flag. It is for servlets only.



Important:

  • Any servlet-webdir setting that starts with a slash ("/") enables invocation by class name. This presents a significant security risk and should not be used in a production environment. You can disable invocation by class name with a setting of servlet-webdir="" (empty quotes) or by setting the OC4J system property http.webdir.enable to a value of false.

  • The servlet-webdir attribute for an application takes its default value from global-web-application.xml if there is a setting there. If there is no setting in global-web-application.xml, then the default value is "".

Also see "Servlet Invocation by Class Name During OC4J Development" and "Additional Security Considerations".


<classpath ... >

Use this to inform OC4J of additional code locations for Web application classloading--either library files or locations for individual class files.

Attribute of <classpath>:

<context-param-mapping ... >deploymentValue</context-param-mapping>

In orion-web.xml, this overrides the value of a context-param setting in the web.xml file. It is used to keep the EAR assembly clean of deployment-specific values. The new value is specified in the tag body.

Attribute of <context-param-mapping>:

<mime-mappings ... >

This defines the path to a file containing MIME mappings to use.

Attribute of <mime-mappings>:

<virtual-directory ... >

This adds a virtual directory mapping for static content, working in a way that is conceptually similar to symbolic links on a UNIX system, for example. The virtual directory enables you to make the contents of the real document root directory available to the application without physically residing in the Web application WAR file. This would be useful, for example, to link an enterprise-wide error page into multiple WAR files.

Attributes of <virtual-directory>:

<access-mask ... >

Use subelements of <access-mask> to specify optional access masks for this application. You can use host names or domains to filter clients, through <host-access> subelements, or you can use IP addresses and subnets to filter clients, through <ip-access> subelements, or you can do both.

Subelements of <access-mask>:

<host-access>
<ip-access>

Attribute of <access-mask>:

<host-access ... >

This subelement of <access-mask> specifies a host name or domain from which to allow or deny access.

Attributes of <host-access>:

<ip-access ... >

This subelement of <access-mask> specifies an IP address and subnet mask from which to allow or deny access.

Attributes of <ip-access>:

<cluster-config ... >

Use this element if, and only if, you want to use OC4J clustering. Remove it or comment it out otherwise. Clustered applications have their HTTP session data replicated between clusters in the cluster island. Objects in the HTTP session data must be serializable (directly or indirectly implementing the java.io.Serializable interface) or remoteable (directly or indirectly implementing the java.rmi.Remote interface) for the session replication to work.

See the Oracle Application Server 10g Performance Guide for general information about clustering.

Attributes of <cluster-config>:

<servlet-chaining ... >

This element specifies a servlet to call when the response of the current servlet is set to a specified MIME type. The specified servlet will be called after the current servlet. This is known as servlet chaining, for filtering or transforming certain kinds of output.


Note:

Servlet chaining is an older mechanism with essentially the same functionality as standard servlet filtering, which was introduced in the servlet 2.3 specification. It is advisable to use servlet filtering instead. See "Servlet Filters".


Attributes of <servlet-chaining>:

<request-tracker ... >

This element of specifies a servlet to use as a request tracker. Request trackers are useful for logging information, for example.

You must define any request trackers in orion-web.xml, not global-web-application.xml, because a <request-tracker> element points to a servlet that is defined within the same application.

A request tracker is invoked for each separate request sent from a browser to the server, at the time that the corresponding response is committed (immediately before the response is actually sent).

There can be multiple request trackers, each one defined in a separate <request-tracker> element.

Attribute of <request-tracker>:

<session-tracking ... >

This element specifies the session-tracking settings for this application. Session tracking is accomplished through cookies, assuming a cookie-enabled browser.


Notes:

  • If cookies are disabled, session tracking can be achieved only if your servlet explicitly calls the encodeURL() method of the response object, or the encodeRedirectURL() method for redirects.

  • OC4J does not support auto-encoding, where session IDs are automatically encoded into the URL by the servlet container. This is a non-standard and expensive process. Therefore, the <session-tracking> attributes autoencode-urls and autoencode-absolute-urls are not supported. Also see "Session Tracking in OC4J".


For general information about servlet sessions, see "Servlet Sessions".

The servlet to use as the session tracker is specified through a subelement.

Subelement of <session-tracking>:

<session-tracker>

Attributes of <session-tracking>:

<session-tracker ... >

This subelement of <session-tracking> specifies a servlet to use as a session tracker. Session trackers are useful for logging information, for example.

You must define any session trackers in orion-web.xml, not global-web-application.xml, because a <session-tracker> element points to a servlet that is defined within the same application.

A session tracker is invoked as soon as a session is created; specifically, at the same time as the invocation of the sessionCreated() method of the HTTP session listener (an instance of a class implementing the javax.servlet.http.HttpSessionListener interface).

There can be multiple session trackers, each one defined in a separate <session-tracker> element.

Attribute of <session-tracker>:

<resource-ref-mapping ... >

Use this element to declare a reference to an external resource such as a data source, JMS queue, or mail session. This ties a resource reference name to a JNDI location when deploying.

Subelement of <resource-ref-mapping>:

<lookup-context>

Attributes of <resource-ref-mapping>:

<lookup-context ... >

This subelement of <resource-ref-mapping> specifies an optional JNDI context (javax.naming.Context instance) that will be used to retrieve the resource. This is useful when connecting to third-party modules, such as a third-party JMS server, for example. Either use the JNDI context implementation supplied by the resource vendor, or, if none exists, write an implementation that in turn negotiates with the vendor software.

Subelement of <lookup-context>:

<context-attribute>

Attribute of <lookup-context>:

<context-attribute ... >

This subelement of <lookup-context> (which is a subelement of <resource-ref-mapping>) specifies an attribute to send to the "foreign", such as third-party, JNDI context.

The only mandatory attribute in JNDI is java.naming.factory.initial, which is the class name of the context factory implementation.

Attributes of <context-attribute>:

<env-entry-mapping ... >deploymentValue</env-entry-mapping>

In orion-web.xml, this element overrides the value of an env-entry setting in the web.xml file. It is used to keep the EAR assembly clean of deployment-specific values. The new value is specified in the tag body.

Attribute of <env-entry-mapping>:

<security-role-mapping ... >

This element maps a security role to specified users and groups or to all users. It maps to a security role of the same name in the web.xml file. The impliesAll attribute or an appropriate combination of subelements--<group>, <user>, or both--should be used.

See the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide for additional information about the <security-role-mapping> element in OC4J configuration files.

Subelements of <security-role-mapping>:

<group>
<user>

Attributes of <security-role-mapping>:


Important:

OC4J has an automatic security mapping feature. By default, if a security role defined in web.xml has the same name as an OC4J group defined in jazn-data.xml (or other valid user managers), then OC4J will map them. However, this feature is completely disabled if you do any explicit mapping through the <security-role-mapping> element. If you use <security-role-mapping> at all, OC4J assumes that you want explicit mapping only. This is to prevent unintended implicit mappings when a user might intend to declare explicit mappings only.


<group ... >

Use this subelement of <security-role-mapping> to specify a group to map to the security role of the parent <security-role-mapping> element. All the members of the specified group are included in this role.

Attribute of <group>:

<user ... >

Use this subelement of <security-role-mapping> to specify a user to map to the security role of the parent <security-role-mapping> element.

Attribute of <user>:

<ejb-ref-mapping ... >

This element creates a mapping between an EJB reference, defined in an <ejb-ref> element, and a JNDI location when deploying.

The <ejb-ref> element can appear within the <web-app> element of orion-web.xml or web.xml and is used to declare a reference to an EJB.

Attributes of <ejb-ref-mapping>:

<expiration-setting ... >

This element sets the expiration for a given set of resources; that is, how long before the resources would expire in the browser. (The browser reloads an expired resource upon the next request for it.) This is useful for caching policies, such as for not reloading images as frequently as documents.

Attributes of <expiration-setting>:

<jazn-web-app ... >

Use this element to configure the OracleAS JAAS Provider and Single Sign-On (SSO) properties for servlet execution. These features must be set appropriately in order to invoke a servlet under the privileges of a particular security subject.

Attributes of <jazn-web-app>:

For additional information about JAAS and the features described for this element, see the Oracle Application Server Containers for J2EE Security Guide. You can also refer to Sun Microsystems documentation at the following location:

http://java.sun.com/j2se/1.4.1/docs/guide/security/jaas/JAASRefGuide.html

<web-app-class-loader ... >

Use this element for classloading instructions. See "Loading WAR File Classes Before System Classes in OC4J" for additional information.

Attributes of <web-app-class-loader>:


Notes:

  • If both attributes are set to "true", the overall classpath is constructed so that classes physically residing in the WAR file are loaded prior to any classes from the WAR file manifest classpath. So you can assume that in the event of any conflict, classes physically residing in the WAR file would take precedence.

  • In accordance with the servlet specification, search-local-classes-first functionality cannot be used in loading classes in java.* or javax.* packages.


<authenticate-on-dispatch ... >

Use this element to disable OC4J authentication of forward or include targets.

Attributes of <authenticate-on-dispatch>:

<web-app ... >

This element is used as in the standard web.xml file; see the servlet specification for details. In global-web-application.xml, defaults for <web-app> settings can be established. In web.xml, application-specific <web-app> settings can override the defaults. In orion-web.xml, deployment-specific <web-app> settings can override the settings in web.xml.

DTD for global-web-application.xml and orion-web.xml

This section provides the OC4J-specific portion of the DTD for the global-web-application.xml and orion-web.xml files in the OC4J 9.0.4 implementation. This does not include the DTD portion for the standard <web-app> element of the web.xml file. (The DTD for global-web-application.xml and orion-web.xml is a superset of the standard web.xml DTD.)

<!ENTITY % CHARSET "CDATA">

<!ENTITY % WEBPATH "CDATA">

<!ENTITY % NUMBER "CDATA">

<!ENTITY % HOST "CDATA">

<!ENTITY % PATH "CDATA">

<!ENTITY % CLASSNAME "CDATA">

<!-- A group that this security-role-mapping implies. Ie all the members of the
 specified group are included in this role. -->
<!ELEMENT group (#PCDATA)>
<!ATTLIST group name CDATA #IMPLIED
>

<!-- An attribute sent to the context. The only mandatory attribute in JNDI is
 the 'java.naming.factory.initial' which is the classname of the context factory
 implementation. -->
<!ELEMENT context-attribute (#PCDATA)>
<!ATTLIST context-attribute name CDATA #IMPLIED
value CDATA #IMPLIED
>

<!-- Defines the relative/absolute path to a file containing mime-mappings to
 use. -->
<!ELEMENT mime-mappings (#PCDATA)>
<!ATTLIST mime-mappings path CDATA #IMPLIED
>

<!-- Specifies a codebase where classes used by this application (such as
 servlets/beans) can be found. -->
<!ELEMENT classpath (#PCDATA)>
<!ATTLIST classpath path CDATA #REQUIRED
>

<!-- The specification of an optional javax.naming.Context implementation used
 for retrieving the resource. This is useful when hooking up with 3rd party
 modules, such as a 3rd party JMS server for instance. Either use the context
 implementation supplied by the resource vendor or if none exists write an
 implementation which in turn negotiates with the vendor software. -->
<!ELEMENT lookup-context (context-attribute+)>
<!ATTLIST lookup-context location CDATA #IMPLIED
>

<!-- Specifies a servlet to use as request-tracker; request-trackers are invoked
 for every request and are useful for logging purposes, for example -->
<!ELEMENT request-tracker (#PCDATA)>
<!ATTLIST request-tracker servlet-name CDATA #IMPLIED
>

<!-- The resource-ref element is used for the declaration of a reference to 
 an external resource such as a datasource, JMS queue, mail session or similar.
 The resource-ref-mapping ties this to a JNDI-location when deploying. -->
<!ELEMENT resource-ref-mapping (lookup-context?)>
<!ATTLIST resource-ref-mapping location CDATA #IMPLIED
name CDATA #REQUIRED
>

<!-- Tag that is defined if the application is to be clustered. Clustered
 applications have their ServletContext and session data
 shared between the apps in the cluster, the values have to be either
 Serializable or be remote RMI-objects (implement java.rmi.Remote). -->
<!ELEMENT cluster-config (#PCDATA)>
<!ATTLIST cluster-config host %HOST; "230.0.0.1"
id CDATA "based on local IP"
port %NUMBER; "9127"
>

<!-- Specifies an optional access-mask for this application, hostnames and
 ip/subnets can be used to filter out allowed clients of this application. -->
<!ELEMENT access-mask (host-access*, ip-access*)>
<!ATTLIST access-mask default (allow|deny) "allow"
>

<!-- Overrides the value of an env-entry in the assembly descriptor. It is used
 to keep the .ear (assembly) clean from deployment-specific values. The body is
 the value. -->
<!ELEMENT env-entry-mapping (#PCDATA)>
<!ATTLIST env-entry-mapping name CDATA #IMPLIED
>


<!-- Specifies the Expires setting for a given set of resources, useful for
 caching policies (for instance for browsers not to reload images as frequently
 as documents). -->
<!ELEMENT expiration-setting (#PCDATA)>
<!ATTLIST expiration-setting expires CDATA #IMPLIED
url-pattern CDATA #IMPLIED
>

<!-- Overrides the value of a context-param in the assembly descriptor. It is
 used to keep the .ear (assembly) clean from deployment-specific values. The
 body is the value. -->
<!ELEMENT context-param-mapping (#PCDATA)>
<!ATTLIST context-param-mapping name CDATA #IMPLIED
>

<!-- Session-tracking settings for this application. -->
<!ELEMENT session-tracking (session-tracker*)>
<!ATTLIST session-tracking autoencode-absolute-urls (true|false) "false"
autoencode-urls (true|false) "true"
autojoin-session (true|false) "false"
cookie-domain CDATA #IMPLIED
cookie-max-age %NUMBER; "in memory only"
cookies (enabled|disabled) "enabled"
>

<!-- A user that this security-role-mapping implies. -->
<!ELEMENT user (#PCDATA)>
<!ATTLIST user name CDATA #IMPLIED
>

<!-- Adds a virtual directory mapping, used to include files that doesnt
 physically reside below the document-root among the web-exposed files. -->
<!ELEMENT virtual-directory (#PCDATA)>
<!ATTLIST virtual-directory real-path %PATH; #IMPLIED
virtual-path %PATH; #IMPLIED
>

<!-- Specifies an ip/netmask who is allowed access. -->
<!ELEMENT ip-access (#PCDATA)>
<!ATTLIST ip-access ip CDATA #REQUIRED
mode (allow|deny) #REQUIRED
netmask CDATA #IMPLIED
>

<!-- Specifies a servlet to use as chainer for a specified mime-type. Useful to
 filter/transform certain kinds of output. -->
<!ELEMENT servlet-chaining (#PCDATA)>
<!ATTLIST servlet-chaining mime-type CDATA #IMPLIED
servlet-name CDATA #IMPLIED
>

<!-- Specifies a domain or netmask who is allowed access. -->
<!ELEMENT host-access (#PCDATA)>
<!ATTLIST host-access domain CDATA #REQUIRED
mode (allow|deny) #REQUIRED
>

<!-- The ejb-ref element is used for the declaration of a reference to
 another enterprise bean's home. The ejb-ref-mapping ties this to JNDI-location
 when deploying. -->
<!ELEMENT ejb-ref-mapping (#PCDATA)>
<!ATTLIST ejb-ref-mapping location CDATA #IMPLIED
name CDATA #REQUIRED
>

<!-- The runtime mapping (to groups and users) of a role. Maps to a
 security-role of the same name in the assembly descriptor. -->
<!ELEMENT security-role-mapping (group*, user*)>
<!ATTLIST security-role-mapping impliesAll CDATA #IMPLIED
name CDATA #IMPLIED
>

<!-- Specifies a servlet to use as session-tracker; session-trackers are invoked
 as soon as a session is created and are useful for logging purposes, for
 example -->
<!ELEMENT session-tracker (#PCDATA)>
<!ATTLIST session-tracker servlet-name CDATA #IMPLIED
>

<!-- JAZN configuration -->
<!ELEMENT jazn-web-app (#PCDATA)>
<!ATTLIST jazn-web-app auth-method CDATA #IMPLIED
runas-mode (true | false) "false"
doasprivileged-mode (true | false) "true"
>

<!-- Web-app classloader configuration -->
<!ELEMENT web-app-class-loader EMPTY>
<!ATTLIST web-app-class-loader
search-local-classes-first (true | false) "false"
include-war-manifest-class-path (true | false) "true"
>

<!-- Authentication of forward/include targets -->
<!ELEMENT authenticate-on-dispatch EMPTY>
<!ATTLIST authenticate-on-dispatch
value (true | false) "true"
>

<!-- This file contains the orion-specific configuration for a web-application.
 The path to the file is located at
 ORION_HOME/application-deployments/deploymentName/warname(.war)/orion-web.xml
 or (web-app-root/)WEB-INF/orion-web.xml if no deployment-directory is specified
 in server.xml. -->
<!ELEMENT orion-web-app (  classpath*,  context-param-mapping*,  mime-mappings*,
  virtual-directory*,  access-mask?,  cluster-config?,  servlet-chaining*,
  request-tracker*,  session-tracking?,  resource-ref-mapping*,
  security-role-mapping*,  env-entry-mapping*,  ejb-ref-mapping*,
  expiration-setting*,  web-app?, jazn-web-app?, web-app-class-loader?,
  authenticate-on-dispatch? )>
<!ATTLIST orion-web-app autoreload-jsp-beans (true|false) "true"
autoreload-jsp-pages (true|false) "true"
default-buffer-size CDATA "2048"
default-charset %CHARSET; "iso-8859-1"
deployment-version CDATA #IMPLIED
development (true|false) "false"
directory-browsing (allow|deny) "deny"
file-modification-check-interval %NUMBER; "1000"
jsp-cache-directory CDATA #IMPLIED
jsp-cache-tlds (true|fase) "true"
jsp-taglib-locations CDATA #IMPLIED
jsp-print-null (true|false) "true"
jsp-timeout %NUMBER; "0 (never)"
simple-jsp-mapping (true|false) "false"
enable-jsp-dispatcher-shortcut (true|false) "true"
persistence-path CDATA #IMPLIED
servlet-webdir %PATH; "/servlet/"
source-directory CDATA #IMPLIED
temporary-directory CDATA #IMPLIED
>

Hierarchical Representation of global-web-application.xml and orion-web.xml

This section provides a graphical representation of the hierarchy of the global-web-application.xml and orion-web.xml files.


Note:

For simplicity of presentation, end-tags are omitted.


<orion-web-app default-buffer-size="..." default-charset="..."
               deployment-version="..." development="..."
               source-directory="..." directory-browsing="..."
               file-modification-check-interval="..."
               jsp-print-null="..." jsp-timeout="..." jsp-cache-directory="..."
               jsp-cache-tlds="..." jsp-taglib-locations="..."
               simple-jsp-mapping="..." enable-jsp-dispatcher-shortcut="..."
               persistence-path="..." servlet-webdir="..." 
               temporary-directory="...">
     <classpath path="...">
     <context-param-mapping name="...">
     <mime-mappings path="...">
     <virtual-directory real-path="..." virtual-path="...">
     <access-mask default="...">
          <host-access domain="..." mode="...">
          <ip-access ip="..." netmask="..." mode="...">
     <cluster-config host="..." id="..." port="...">
     <servlet-chaining mime-type="..." servlet-name="...">
     <request-tracker servlet-name="...">
     <session-tracking autojoin-session="..." cookies="..."
                       cookie-domain="..." cookie-max-age="...">
          <session-tracker servlet-name="...">
     <resource-ref-mapping location="..." name="...">
          <lookup-context location="...">
               <context-attribute name="..." value="...">
     <env-entry-mapping name="...">
     <security-role-mapping impliesAll="..." name="...">
          <group name="...">
          <user name="...">
     <ejb-ref-mapping location="..." name="...">
     <expiration-setting expires="..." url-pattern="...">
     <jazn-web-app auth-method="..." runas-mode="..."
                   doasprivileged-mode="...">
     <web-app-class-loader search-local-classes-first="..."
                           include-war-manifest-class-path="...">
     <authenticate-on-dispatch value="...">
     <web-app>   AS IN STANDARD WEB.XML

Sample global-web-application.xml Settings

This is an abbreviated example of a default global-web-application.xml file, showing some <orion-web-app> attribute settings, mime-mapping settings, and the setup and mapping of the JSP and RMI front-end servlets (all possibly subject to change in the shipped product):

<?xml version="1.0" standalone='yes'?>
<!DOCTYPE orion-web-app PUBLIC '//Evermind//Orion web-application'
 'http://xmlns.oracle.com/ias/dtds/orion-web.dtd'>

<orion-web-app
   jsp-cache-directory="./persistence"
   servlet-webdir="/servlet"
   development="false"
   jsp-timeout="0"
   jsp-taglib-locations="./jsp/lib/taglib"
>

   <!-- The mime-mappings for this server -->
   <mime-mappings path="./mime.types" />

   <web-app>
   
      <servlet>
         <servlet-name>jsp</servlet-name>
         <servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
         <load-on-startup>0</load-on-startup>
         <!-- you can disable page scope listener if you 
              don't need this function. --> 
         <init-param>
            <param-name>check_page_scope</param-name>
            <param-value>true</param-value>
         </init-param>
         <!-- you can set main_mode to "justrun" to speed up
              JSP dispatching, if you don't need to recompile
              your JSP anymore. You can always switch your
              main_mode. Please see our doc for details -->
         <!--
         <init-param>
            <param-name>main_mode</param-name>
            <param-value>justrun</param-value>
         </init-param>
         -->
      </servlet>

      <servlet-mapping>
         <servlet-name>jsp</servlet-name>
         <url-pattern>/*.jsp</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
         <servlet-name>jsp</servlet-name>
         <url-pattern>/*.JSP</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
         <servlet-name>jsp</servlet-name>
         <url-pattern>/*.sqljsp</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
         <servlet-name>jsp</servlet-name>
         <url-pattern>/*.SQLJSP</url-pattern>
      </servlet-mapping>

      <servlet>
         <servlet-name>rmi</servlet-name>
         <servlet-class>
            com.evermind.server.rmi.RMIHttpTunnelServlet
         </servlet-class>
      </servlet>
      <servlet-mapping>
         <servlet-name>rmi</servlet-name>
         <url-pattern>/*.tunnelrmi</url-pattern>
      </servlet-mapping>

   </web-app>
</orion-web-app>

Configuration for Web Site XML Files

The following sections provide detailed information about Web site XML configuration files, including default-web-site.xml, for an Oracle Application Server environment, and http-web-site.xml, for an OC4J standalone environment:

For an overview of these files, see "OC4J Web Site Descriptors".

Element Descriptions for Web Site XML Files

The element descriptions in this section apply to any OC4J Web site XML file, including default-web-site.xml (Oracle Application Server) and http-web-site.xml (OC4J standalone).

<web-site ... >

This is the root element for configuring an OC4J Web site.

Subelements of <web-site>:

<description>
<frontend>
<web-app>
<default-web-app>
<user-web-apps>
<access-log>
<odl-access-log>
<ssl-config>

Attributes of <web-site>:


Note:

SSL and HTTPS features are also available through Oracle HTTP Server for communication between Oracle HTTP Server and the client. For information, see Oracle Application Server 10g Security Guide.



Important:

In a UNIX environment, port numbers less than 1024 require root privileges for access. Also note that if there is no port specification from the client browser, port 80 is assumed for HTTP protocol and port 443 for HTTPS.


<description>This is the description.</description>

You can use the body of this element for a brief description of the Web site.

<frontend ... >

This specifies a perceived front-end host and port of this Web site as seen by HTTP clients. When the site is behind a load balancer or firewall, the <frontend> specification is necessary to provide appropriate information to Web application code for functionality such as URL rewriting. Using the host and port specified in the <frontend> element, the back-end server that is actually running the application knows to refer to the front-end instead of to itself in any URL rewriting. This way, subsequent requests properly come in through the front-end again instead of trying to access the back-end directly.

Attributes of <frontend>:

<web-app ... >

This element binds a particular Web module to this Web site. It specifies the name of a J2EE application archive (EAR file name minus the .ear extension) from the server.xml file, and the name of a Web module within the J2EE application. The Web module would be defined in the J2EE application.xml file in the application EAR file (or possibly in the orion-application.xml file in the EAR file). The Web module is bound at the location specified by the <web-app> element root attribute.


Note:

It is possible to deploy a WAR file by itself, instead of within an EAR file. In OC4J standalone, such Web applications would be added to the OC4J default application. (In OC4J, there must always be a parent application of some sort.) See "OC4J Default Application and Default Web Application" for more information.

In this scenario, the Web site XML file <web-app> element specifies the name of the default application rather than the name of a J2EE application archive. More details are provided in the attribute descriptions and examples that follow.


Mapping to and from Web site XML files, particularly with respect to the application and name attributes, is shown in examples elsewhere in this document. See "Example: Mappings to and from Web Site Descriptors" (for a typical scenario of deploying a WAR file within an EAR file) and "Deploying an Independent WAR File to OC4J Standalone" (for the scenario of deploying a WAR file by itself to the OC4J default application).

Attributes of <web-app>:


Note:

If you deploy a WAR file by itself in OC4J standalone, using the OC4J default application as the parent, then the application attribute would instead reflect the name of the default application, according to the <global-application> element in the server.xml file.



Notes:

  • If you deploy a WAR file by itself in OC4J standalone, using the OC4J default application as the parent, then the name attribute would instead reflect the value of the id attribute of a <web-module> element in the OC4J global application.xml file. This is the application.xml file for the OC4J default application, but be aware that it is not a standard J2EE file; it is OC4J-specific. Also note that the id attribute, like the <web-app> name attribute, does not have the .war extension.

  • An application can also have an orion-application.xml file in the EAR file, with <web-module> elements that define additional Web modules, or even override Web modules defined in the J2EE application.xml file (although overriding is not advised). The name attribute can reflect the id value of a <web-module> element in orion-application.xml, instead of reflecting a <web-uri> value in the J2EE application.xml file.

  • The orion-application.xml file uses the same DTD as the OC4J global application.xml file; namely, orion-application.dtd.



Important:

  • The root attribute overrides the <context-root> value of the corresponding <web> element in the J2EE application.xml file. So even though the <context-root> element is mandatory in an application.xml file, its value is not used by OC4J.

  • Specifying a root setting of "/" will override the OC4J default Web application. This setting or a null setting is not allowed by the admin.jar utility when binding a Web application to the Web site.



Important:

Use shared="true" only in OC4J standalone.


<default-web-app ... >

This element creates a reference to the default Web application of this Web site. For users, it is meaningful only in an OC4J standalone environment. See "OC4J Default Application and Default Web Application" for more information.

In an Oracle Application Server environment, the OC4J default Web application has system-level functionality but is not otherwise meaningful. See "OC4J Default Web Application in Oracle Application Server".

Attributes of <default-web-app> are the same as for the <web-app> element described immediately above, but note that the default setting of load-on-startup is "true".

<user-web-apps ... >

Use this element to support user directories and applications. Each user has his or her own Web module and associated web-application.xml file. User applications are reached at /username/ from the server root.

Attributes of <user-web-apps>:

<access-log ... >

Use this element to enable text-based access logging for this Web site and to specify information about the access log, including the path, file name, and what information is included. The log file is where incoming requests (each access of the Web site) are logged.

Alternatively, use the <odl-access-log> element (described immediately below) for ODL logging. See "Oracle Diagnostic Logging Versus Text-Based Logging" for information about ODL.


Note:

Do not use both <access-log> and <odl-access-log>; you can use only one type of logging. (The last element in the Web site XML file would take precedence, but do not count on this behavior.)


Attributes of <access-log>:


Note:

Note the difference between the path attribute of <access-log>, which specifies a path and file name, and the path attribute of <odl-access-log>, which specifies a path only. (ODL log file names are fixed.)


<odl-access-log ... >

Use this element to enable ODL-based access logging for the Web site and to specify information about the access logs, including the path, and maximum values for the size of each file and the total size of all files in the log directory. The log files are where incoming requests (each access of the Web site) are logged.

Alternatively, use the <access-log> element (described immediately above) for text-based logging.

See "Oracle Diagnostic Logging Versus Text-Based Logging" for information about ODL.


Note:

Do not use both <access-log> and <odl-access-log>; you can only use one type of logging or the other. (The last element in the Web site XML file would take precedence, but do not count on this behavior.)


Attributes of <odl-access-log>:


Note:

Note the difference between the path attribute of <access-log>, which specifies a path and file name, and the path attribute of <odl-access-log>, which specifies a path only. (ODL log file names are fixed.)


<ssl-config ... >

This element specifies SSL configuration settings, if applicable. You must use it whenever you set the secure attribute of the <web-site> element to "true".

See "Servlet Security" for related information.

Subelement of <ssl-config>:

<property>

Attributes of <ssl-config>:

<property ... >

Use <property> subelements of the <ssl-config> element to pass parameters to a third-party SSLServerSocketFactory implementation, if applicable.

Attributes of <property>:

DTD for Web Site XML Files

This section provides the DTD for Web site XML configuration files, including default-web-site.xml and http-web-site.xml, in the OC4J 9.0.4 implementation.

<!ENTITY % WEBPATH "CDATA">

<!ENTITY % NUMBER "CDATA">

<!ENTITY % HOST "CDATA">

<!ENTITY % BOOLEAN "true|false">

<!ENTITY % PATH "CDATA">

<!-- When enabled user dirs/apps will be supported. Each user has his own
 private web-application (and connected web-application.xml file).
 The user apps are reached at /~username/ from the server root. -->
<!ELEMENT user-web-apps (#PCDATA)>
<!ATTLIST user-web-apps max-inactivity-time CDATA "no shutdown"
path %PATH; #IMPLIED
>

<!-- Reference to the default <a class="link"
 href="web.xml.html">web-application</a> of this site. This application will be
 bound to the root of the site. -->
<!ELEMENT default-web-app (#PCDATA)>
<!ATTLIST default-web-app application CDATA #IMPLIED
load-on-startup (true|false) "true"
max-inactivity-time %NUMBER; #IMPLIED
name CDATA #IMPLIED
root %WEBPATH; #IMPLIED
shared (true|false) "false"
>

<!-- A short description of this web-site. -->
<!ELEMENT description (#PCDATA)>

<!-- Relative/absolute path to the access-log for this site, this is where
 incoming requests will be logged. -->
<!ELEMENT access-log (#PCDATA)>
<!ATTLIST access-log format CDATA "$ip - $user - [$time] '$request' $status
 $size"
path CDATA #IMPLIED
split (none|hour|day|week|month) "none"
suffix CDATA #IMPLIED
>

<!-- An ODL formated log file. The max-file-size is the maximum number of
 kilobytes a single log file is allowed to grow to. The max-directory-size is
 the maximum number of kilobytes that the directory is allowed to contain. -->
<!ELEMENT odl-access-log (#PCDATA)>
<!ATTLIST odl-access-log path CDATA #REQUIRED max-file-size CDATA #IMPLIED
 max-directory-size CDATA #IMPLIED>

<!-- Reference to a <a class="link" href="web.xml.html">web-application</a>.
 This application will be bound at the location specified by the 'root'
 attribute. -->
<!ELEMENT web-app (#PCDATA)>
<!ATTLIST web-app application CDATA #IMPLIED
load-on-startup (true|false) "false"
max-inactivity-time %NUMBER; "no shutdown"
name CDATA #IMPLIED
root %WEBPATH; #IMPLIED
shared (true|false) "false"
>

<!-- A configuration parameter. -->
<!ELEMENT property (#PCDATA)>
<!ATTLIST property name CDATA #IMPLIED
value CDATA #IMPLIED
>

<!-- Specifies SSL-configuration settings. These settings are used if
secure="true" is specified on the site.
If a 3rd party SSLServerSocketFactory implementation is used then x property
tags can be defined to send arbitary arguments to the factory. -->
<!ELEMENT ssl-config (property*)>
<!ATTLIST ssl-config factory CDATA
 "com.evermind.server.JSSESSLServerSocketFactory"
keystore CDATA #IMPLIED
keystore-password CDATA #IMPLIED
needs-client-auth (true|false) "false"
provider CDATA #IMPLIED
>

<!-- The frontend tag describes which IP, port, and so on that HTTP clients
 perceive this site to be. This is needed when acting behind a load balancer or
 firewall in order to provide the correct info to web-app code when rewriting
 URLs -->
<!ELEMENT frontend (#PCDATA)>
<!ATTLIST frontend host CDATA #IMPLIED
port CDATA #IMPLIED
>

<!-- This file contains the configuration for a web-site. -->
<!ELEMENT web-site (description?, frontend?, default-web-app, web-app*,
 user-web-apps?, access-log?, odl-access-log?, ssl-config?)>
<!ATTLIST web-site cluster-island CDATA #IMPLIED
display-name CDATA #IMPLIED
protocol CDATA #IMPLIED
host %HOST; "[ALL]"
log-request-info (true|false) "false"
max-request-size CDATA #IMPLIED
port %NUMBER; "80"
secure (true|false) "false"
use-keep-alives CDATA #IMPLIED
virtual-hosts CDATA #IMPLIED
>

Hierarchical Representation of Web Site XML Files

This section provides a graphical representation of the hierarchy of Web site XML configuration files, including default-web-site.xml and http-web-site.xml.


Note:

For simplicity of presentation, end-tags are omitted.


<web-site cluster-island="..." display-name="..." host="..."
          log-request-info="..." max-request-size="..." secure="..."
          protocol="..." port="..." use-keep-alives="..."
          virtual-hosts="...">
     <description>
     <frontend host="..." port="...">
     <web-app application="..." load-on-startup="..."
              max-inactivity-time="..." name="..." root="..." shared="...">
     <default-web-app application="..." load-on-startup="..."
              max-inactivity-time="..." name="..." root="..." shared="...">
     <user-web-apps max-inactivity-time="..." path="...">
     <access-log format="..." path="..." split="..." suffix="...">
     <odl-access-log path="..." max-file-size="..." max-directory-size="...">
     <ssl-config keystore="..." keystore-password="..."
                 needs-client-auth="..." provider="..." factory="...">
          <property name="..." value="...">

Sample default-web-site.xml File

This is a sample default-web-site.xml file, similar to the default file provided with OC4J for an Oracle Application Server environment:

<?xml version="1.0" standalone='yes'?>
<!DOCTYPE web-site PUBLIC "Oracle Application Server XML Web-site"
 "http://xmlns.oracle.com/ias/dtds/web-site.dtd">

<web-site host="myhost" port="0"  protocol="ajp13" 
          display-name="Default Oracle Application Server Java WebSite"
          cluster-island="1" >
   <!-- Uncomment the following line when using clustering -->
   <!-- <frontend host="your_host_name" port="80" /> -->
   <!-- The default web-app for this site, bound to the root -->
   <default-web-app application="default" name="defaultWebApp" root="/j2ee" />
   <web-app application="default" name="dms" root="/dmsoc4j" />
   <web-app application="default" name="admin_web" root="/adminoc4j" />

   <!-- Access Log, where requests are logged to -->
   <access-log path="../log/default-web-access.log" />

   <!-- Uncomment this if you want to use ODL logging capabilities
   <odl-access-log path="../log/default-web-access" max-file-size="1000"
                   max-directory-size="10000"/>
   -->

</web-site>

Go to previous page Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index