TomcatConfigSupportSpec

THIS DOCUMENT IS STILL A DRAFT

Tomcat context.xml configuration support specification

This document describes Tomcat plug-in support for managing context.xml configuration descriptor.

Overview

Tomcat plug-in supports management of context path and data source definitions in context.xml descriptor by implementing org.netbeans.modules.j2ee.deployment.plugins.spi.config.ContextRootConfiguration and org.netbeans.modules.j2ee.deployment.plugins.spi.config.DatasourceConfiguration interfaces. The implementation itself resides in org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration class.

At the moment Tomcat plug-in supports the following versions of Apache Tomcat: 5.0.x, 5.5.x and 6.0.x.

Please note that context.xml descriptors for Apache Tomcat 5.0 and Apache Tomcat 5.5 are not fully compatible, while Apache Tomcat 5.5 and 6.0 are. All the relevant differences will be mentioned later in this document.

Context root

Apache Tomcat: 5.5, 6.0

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test"/>

Apache Tomcat: 5.0

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test">
  <Logger className="org.apache.catalina.logger.FileLogger" prefix="test." suffix=".log" timestamp="true"/>
</Context>

Datasources

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test">
  <Resource auth="Container" driverClassName="org.apache.derby.jdbc.ClientDriver" maxActive="20" 
            maxIdle="10" maxWait="-1" name="jdbc/derby" password="app" type="javax.sql.DataSource" 
            url="jdbc:derby://localhost:1527/sample" username="app"/>
</Context>
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test">
  <Logger className="org.apache.catalina.logger.FileLogger" prefix="test." suffix=".log" timestamp="true"/>
  <Resource auth="Container" name="jdbc/derby" type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/derby">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>org.apache.derby.jdbc.ClientDriver</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:derby://localhost:1527/sample</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>app</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>app</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>20</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>-1</value>
    </parameter>
  </ResourceParams>
</Context>

Tomcat Documentation

context.xml

server.xml

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo