Creating a New Application J2ee Web Site in OC4J

Card Puncher Data Processing

Creating a New Application J2ee Web Site in OC4J

oc4j java web_site

If you want to create virtual host of a web site without j2ee application, look at this article : OC4J - Setting Up Virtual Hosts

Creating the Web Site Configuration File

The most straightforward way to create a new configuration file is to make a copy of the default Web site configuration file, default-web-site.xml, which is located in the ORACLE_HOME/j2ee/instance/config directory. Name the file according to the following convention:


As an example, assume that you will create a configuration file named gerardnico-web-site.xml, which defines a Web site that will be used exclusively to provide management access to Application Server Control. The root

element within this file will contain all of the required configuration data, as follows:
<web-site xmlns:xsi=""
  web-site-10_0.xsd"  port="1810"
  display-name="Application Server Control Web Site">
    <default-web-app application="gerardnico" name="gerardnico" access-log="true" />
            <access-log path="../log/gerardnico-web-access.log" />

For details on the structure of this element, see the

]] element description.
Referencing the Web Site Configuration File in server.xml

The location of every Web site configuration file must be referenced in a

element in server.xml, the OC4J configuration file, located in the J2EE_HOME/config directory. Applications will not be able to bind to the Web site unless this declaration exists in server.xml.


element specifies the path and file name for the corresponding Web site XML file, as in the following sample server.xml entries, add this entry :
<web-site path="./gerardnico-web-site.xml" />

sample server.xml

<application-server ... >
  <web-site path="./default-web-site.xml" />
   <web-site path="./gerardnico-web-site.xml" />

In this example, the locations of all of the Web site configuration files are relative to the location of server.xml.

If OC4J polling is disabled, OC4J must be restarted for changes to server.xml to take effect.

Task Runner