升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-uidm/webapps/docs/jndi-resources-howto.html b/tomcat-uidm/webapps/docs/jndi-resources-howto.html
index 0cb10ea..5783e79 100644
--- a/tomcat-uidm/webapps/docs/jndi-resources-howto.html
+++ b/tomcat-uidm/webapps/docs/jndi-resources-howto.html
@@ -1,27 +1,103 @@
-<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 6.0 (6.0.41) - JNDI Resources HOW-TO</title><meta name="author" content="Craig R. McClanahan"><meta name="author" content="Yoav Shapira"><style type="text/css" media="print">
- .noPrint {display: none;}
- td#mainBody {width: 100%;}
- </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
+<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 7 (7.0.77) - JNDI Resources HOW-TO</title><meta name="author" content="Craig R. McClanahan"><meta name="author" content="Yoav Shapira"><style type="text/css" media="print">
+ .noPrint {display: none;}
+ td#mainBody {width: 100%;}
+</style><style type="text/css">
+code {background-color:rgb(224,255,255);padding:0 0.1em;}
+code.attributeName, code.propertyName {background-color:transparent;}
+
+
+table {
+ border-collapse: collapse;
+ text-align: left;
+}
+table *:not(table) {
+ /* Prevent border-collapsing for table child elements like <div> */
+ border-collapse: separate;
+}
+
+th {
+ text-align: left;
+}
+
+
+div.codeBox pre code, code.attributeName, code.propertyName, code.noHighlight, .noHighlight code {
+ background-color: transparent;
+}
+div.codeBox {
+ overflow: auto;
+ margin: 1em 0;
+}
+div.codeBox pre {
+ margin: 0;
+ padding: 4px;
+ border: 1px solid #999;
+ border-radius: 5px;
+ background-color: #eff8ff;
+ display: table; /* To prevent <pre>s from taking the complete available width. */
+ /*
+ When it is officially supported, use the following CSS instead of display: table
+ to prevent big <pre>s from exceeding the browser window:
+ max-width: available;
+ width: min-content;
+ */
+}
+
+div.codeBox pre.wrap {
+ white-space: pre-wrap;
+}
+
+
+table.defaultTable tr, table.detail-table tr {
+ border: 1px solid #CCC;
+}
+
+table.defaultTable tr:nth-child(even), table.detail-table tr:nth-child(even) {
+ background-color: #FAFBFF;
+}
+
+table.defaultTable tr:nth-child(odd), table.detail-table tr:nth-child(odd) {
+ background-color: #EEEFFF;
+}
+
+table.defaultTable th, table.detail-table th {
+ background-color: #88b;
+ color: #fff;
+}
+
+table.defaultTable th, table.defaultTable td, table.detail-table th, table.detail-table td {
+ padding: 5px 8px;
+}
+
+
+p.notice {
+ border: 1px solid rgb(255, 0, 0);
+ background-color: rgb(238, 238, 238);
+ color: rgb(0, 51, 102);
+ padding: 0.5em;
+ margin: 1em 2em 1em 1em;
+}
+</style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
The Apache Tomcat Servlet/JSP Container
- " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.41, May 19 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptor-howto.html">16) MBean Descriptor</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat 6.0</h1><h2>JNDI Resources HOW-TO</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
+ " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 7</font></h1><font face="arial,helvetica,sanserif">Version 7.0.77, Mar 28 2017</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.svg" align="right" alt="Apache Logo" border="0" style="width: 266px;height: 83px;"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL/TLS</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptors-howto.html">16) MBeans Descriptors</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li><li><a href="security-howto.html">28) Security Considerations</a></li><li><a href="windows-service-howto.html">29) Windows Service</a></li><li><a href="windows-auth-howto.html">30) Windows Authentication</a></li><li><a href="jdbc-pool.html">31) Tomcat's JDBC Pool</a></li><li><a href="web-socket-howto.html">32) WebSocket</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Tomcat Javadocs</a></li><li><a href="servletapi/index.html">Servlet Javadocs</a></li><li><a href="jspapi/index.html">JSP 2.2 Javadocs</a></li><li><a href="elapi/index.html">EL 2.2 Javadocs</a></li><li><a href="websocketapi/index.html">WebSocket 1.1 Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li><li><a href="tribes/introduction.html">Tribes</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>JNDI Resources HOW-TO</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
<ul><li><a href="#Introduction">Introduction</a></li><li><a href="#web.xml_configuration">web.xml configuration</a></li><li><a href="#context.xml_configuration">context.xml configuration</a></li><li><a href="#Global_configuration">Global configuration</a></li><li><a href="#Using_resources">Using resources</a></li><li><a href="#Tomcat_Standard_Resource_Factories">Tomcat Standard Resource Factories</a><ol><li><a href="#Generic_JavaBean_Resources">Generic JavaBean Resources</a></li><li><a href="#UserDatabase_Resources">UserDatabase Resources</a></li><li><a href="#JavaMail_Sessions">JavaMail Sessions</a></li><li><a href="#JDBC_Data_Sources">JDBC Data Sources</a></li></ol></li><li><a href="#Adding_Custom_Resource_Factories">Adding Custom Resource Factories</a></li></ul>
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
-<p>Tomcat 6 provides a JNDI <strong>InitialContext</strong> implementation
-instance for each web application running under it, in a manner that is
-compatible with those provided by a
-<a href="http://java.sun.com/j2ee">Java2 Enterprise Edition</a> application
-server. The J2EE standard provides a standard set of elements in the
-<code>/WEB-INF/web.xml</code> file to reference/define resources.</p>
+<p>Tomcat provides a JNDI <strong>InitialContext</strong> implementation
+instance for each web application running under it, in a manner that is
+compatible with those provided by a
+<a href="http://www.oracle.com/technetwork/java/javaee/overview/index.html">
+Java Enterprise Edition</a> application server. The Java EE standard provides
+a standard set of elements in the <code>/WEB-INF/web.xml</code> file to
+reference/define resources.</p>
<p>See the following Specifications for more information about programming APIs
-for JNDI, and for the features supported by Java2 Enterprise Edition (J2EE)
+for JNDI, and for the features supported by Java Enterprise Edition (Java EE)
servers, which Tomcat emulates for the services that it provides:</p>
<ul>
-<li><a href="http://java.sun.com/products/jndi">Java Naming and Directory
- Interface</a> (included in JDK 1.4 onwards)</li>
-<li><a href="http://java.sun.com/j2ee/download.html">J2EE Platform
- Specification</a> (in particular, see Chapter 5 on <em>Naming</em>)</li>
+<li><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/index.html">
+ Java Naming and Directory Interface</a> (included in JDK 1.4 onwards)</li>
+<li><a href="http://www.oracle.com/technetwork/java/javaee/documentation/index.html">
+ Java EE Platform Specification</a> (in particular, see Chapter 5 on <em>Naming</em>)</li>
</ul>
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="web.xml configuration"><!--()--></a><a name="web.xml_configuration"><strong>web.xml configuration</strong></a></font></td></tr><tr><td><blockquote>
@@ -36,7 +112,7 @@
<li><code><strong><resource-ref></strong></code> - Resource reference,
which is typically to an object factory for resources such as a JDBC
<code>DataSource</code>, a JavaMail <code>Session</code>, or custom
- object factories configured into Tomcat 6.</li>
+ object factories configured into Tomcat.</li>
<li><code><strong><resource-env-ref></strong></code> - Resource
environment reference, a new variation of <code>resource-ref</code>
added in Servlet 2.4 that is simpler to configure for resources
@@ -47,6 +123,18 @@
use to create the resource and that no further configuration information is
required, Tomcat will use the information in <code>/WEB-INF/web.xml</code> to
create the resource.</p>
+
+<p>Tomcat provides a number of Tomcat specific options for JNDI resources that
+cannot be specified in web.xml. These include <code>closeMethod</code> that
+enables faster cleaning-up of JNDI resources when a web application stops and
+<code>singleton</code> that controls whether or not a new instance of the
+resource is created for every JNDI lookup. To use these configuration options
+the resource must be specified in a web application's
+<a href="config/context.html"><code><Context></code></a> element or in the
+<a href="config/globalresources.html">
+<code><strong><GlobalNamingResources></strong></code></a> element of
+<code>$CATALINA_BASE/conf/server.xml</code>.</p>
+
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="context.xml configuration"><!--()--></a><a name="context.xml_configuration"><strong>context.xml configuration</strong></a></font></td></tr><tr><td><blockquote>
<p>If Tomcat is unable to identify the appropriate resource factory and/or
@@ -63,25 +151,25 @@
element:</p>
<ul>
-<li><a href="config/context.html#Environment Entries"><Environment></a> -
+<li><a href="config/context.html#Environment_Entries"><Environment></a> -
Configure names and values for scalar environment entries that will be
exposed to the web application through the JNDI
<code>InitialContext</code> (equivalent to the inclusion of an
<code><env-entry></code> element in the web application
deployment descriptor).</li>
-<li><a href="config/context.html#Resource Definitions"><Resource></a> -
+<li><a href="config/context.html#Resource_Definitions"><Resource></a> -
Configure the name and data type of a resource made available to the
application (equivalent to the inclusion of a
<code><resource-ref></code> element in the web application
deployment descriptor).</li>
-<li><a href="config/context.html#Resource Links"><ResourceLink></a> -
- Add a link to a resource defined in the global JNDI context. Use resource
- links to give a web application access to a resource defined in
+<li><a href="config/context.html#Resource_Links"><ResourceLink></a> -
+ Add a link to a resource defined in the global JNDI context. Use resource
+ links to give a web application access to a resource defined in
the <a href="config/globalresources.html"><GlobalNamingResources></a>
child element of the <a href="config/server.html"><Server></a>
element.</li>
<li><a href="config/context.html#Transaction"><Transaction></a> -
- Add a resource factory for instantiating the UserTransaction object
+ Add a resource factory for instantiating the UserTransaction object
instance that is available at <code>java:comp/UserTransaction</code>.</li>
</ul>
@@ -108,17 +196,17 @@
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Global configuration"><!--()--></a><a name="Global_configuration"><strong>Global configuration</strong></a></font></td></tr><tr><td><blockquote>
-<p>Tomcat 6 maintains a separate namespace of global resources for the
-entire server. These are configured in the
+<p>Tomcat maintains a separate namespace of global resources for the
+entire server. These are configured in the
<a href="config/globalresources.html">
-<code><strong><GlobalNamingResources></strong></code></a> element of
-<code>$CATALINA_BASE/conf/server.xml</code>. You may expose these resources to
-web applications by using a
-<a href="config/context.html#Resource Links"><ResourceLink></a> to
+<code><strong><GlobalNamingResources></strong></code></a> element of
+<code>$CATALINA_BASE/conf/server.xml</code>. You may expose these resources to
+web applications by using a
+<a href="config/context.html#Resource_Links"><ResourceLink></a> to
include it in the per-web-application context.</p>
-<p>If a resource has been defined using a
-<a href="config/context.html#Resource Links"><ResourceLink></a>, it is not
+<p>If a resource has been defined using a
+<a href="config/context.html#Resource_Links"><ResourceLink></a>, it is not
necessary for that resource to be defined in <code>/WEB-INF/web.xml</code>.
However, it is recommended to keep the entry in <code>/WEB-INF/web.xml</code>
to document the resource requirements for the web application.</p>
@@ -132,8 +220,7 @@
access to a resource - in this case, to a JDBC <code>DataSource</code> -
would look something like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-// Obtain our environment naming context
+<div class="codeBox"><pre><code>// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
@@ -144,12 +231,11 @@
// Allocate and use a connection from the pool
Connection conn = ds.getConnection();
... use this connection to access the database ...
-conn.close();
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+conn.close();</code></pre></div>
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Tomcat Standard Resource Factories"><!--()--></a><a name="Tomcat_Standard_Resource_Factories"><strong>Tomcat Standard Resource Factories</strong></a></font></td></tr><tr><td><blockquote>
- <p>Tomcat 6 includes a series of standard resource factories that can
+ <p>Tomcat includes a series of standard resource factories that can
provide services to your web applications, but give you configuration
flexibility (via the
<a href="config/context.html"><code><Context></code></a> element)
@@ -157,41 +243,41 @@
subsection below details the configuration and usage of the standard resource
factories.</p>
- <p>See <a href="#Adding Custom Resource Factories">Adding Custom
+ <p>See <a href="#Adding_Custom_Resource_Factories">Adding Custom
Resource Factories</a> for information about how to create, install,
configure, and use your own custom resource factory classes with
- Tomcat 6.</p>
+ Tomcat.</p>
<p><em>NOTE</em> - Of the standard resource factories, only the
"JDBC Data Source" and "User Transaction" factories are mandated to
be available on other platforms, and then they are required only if
- the platform implements the Java2 Enterprise Edition (J2EE) specs.
+ the platform implements the Java Enterprise Edition (Java EE) specs.
All other standard resource factories, plus custom resource factories
that you write yourself, are specific to Tomcat and cannot be assumed
to be available on other containers.</p>
<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Generic JavaBean Resources"><!--()--></a><a name="Generic_JavaBean_Resources"><strong>Generic JavaBean Resources</strong></a></font></td></tr><tr><td><blockquote>
- <h3>0. Introduction</h3>
+ <h5>0. Introduction</h5>
<p>This resource factory can be used to create objects of <em>any</em>
Java class that conforms to standard JavaBeans naming conventions (i.e.
it has a zero-arguments constructor, and has property setters that
conform to the setFoo() naming pattern. The resource factory will
- create a new instance of the appropriate bean class every time a
- <code>lookup()</code> for this entry is made.</p>
+ only create a new instance of the appropriate bean class every time a
+ <code>lookup()</code> for this entry is made if the <code>singleton</code>
+ attribute of the factory is set to <code>false</code>.</p>
<p>The steps required to use this facility are described below.</p>
- <h3>1. Create Your JavaBean Class</h3>
+ <h5>1. Create Your JavaBean Class</h5>
<p>Create the JavaBean class which will be instantiated each time
that the resource factory is looked up. For this example, assume
you create a class <code>com.mycompany.MyBean</code>, which looks
like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-package com.mycompany;
+<div class="codeBox"><pre><code>package com.mycompany;
public class MyBean {
@@ -216,18 +302,16 @@
}
-}
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+}</code></pre></div>
- <h3>2. Declare Your Resource Requirements</h3>
+ <h5>2. Declare Your Resource Requirements</h5>
<p>Next, modify your web application deployment descriptor
(<code>/WEB-INF/web.xml</code>) to declare the JNDI name under which
you will request new instances of this bean. The simplest approach is
to use a <code><resource-env-ref></code> element, like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<resource-env-ref>
+<div class="codeBox"><pre><code><resource-env-ref>
<description>
Object factory for MyBean instances.
</description>
@@ -237,8 +321,7 @@
<resource-env-ref-type>
com.mycompany.MyBean
</resource-env-ref-type>
-</resource-env-ref>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</resource-env-ref></code></pre></div>
<p><strong>WARNING</strong> - Be sure you respect the element ordering
that is required by the DTD for web application deployment descriptors!
@@ -246,36 +329,32 @@
<a href="http://wiki.apache.org/tomcat/Specifications">Servlet
Specification</a> for details.</p>
- <h3>3. Code Your Application's Use Of This Resource</h3>
+ <h5>3. Code Your Application's Use Of This Resource</h5>
<p>A typical use of this resource environment reference might look
like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-Context initCtx = new InitialContext();
+<div class="codeBox"><pre><code>Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
MyBean bean = (MyBean) envCtx.lookup("bean/MyBeanFactory");
writer.println("foo = " + bean.getFoo() + ", bar = " +
- bean.getBar());
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+ bean.getBar());</code></pre></div>
- <h3>4. Configure Tomcat's Resource Factory</h3>
+ <h5>4. Configure Tomcat's Resource Factory</h5>
<p>To configure Tomcat's resource factory, add an element like this to the
<a href="config/context.html"><code><Context></code></a> element for
this web application.</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<Context ...>
+<div class="codeBox"><pre><code><Context ...>
...
<Resource name="bean/MyBeanFactory" auth="Container"
type="com.mycompany.MyBean"
factory="org.apache.naming.factory.BeanFactory"
bar="23"/>
...
-</Context>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</Context></code></pre></div>
<p>Note that the resource name (here, <code>bean/MyBeanFactory</code>
must match the value specified in the web application deployment
@@ -285,59 +364,153 @@
<code>foo</code> property (although we could have), the bean will
contain whatever default value is set up by its constructor.</p>
+ <p>Some beans have properties with types that can not automatically be
+ converted from a string value. Setting such properties using the Tomcat
+ BeanFactory will fail with a NamingException. In cases were those beans
+ provide methods to set the properties from a string value, the Tomcat
+ BeanFactory can be configured to use these methods. The configuration is
+ done with the <code>forceString</code> attribute.</p>
+
+ <p>Assume our bean looks like this:</p>
+
+<div class="codeBox"><pre><code>package com.mycompany;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class MyBean2 {
+
+ private InetAddress local = null;
+
+ public InetAddress getLocal() {
+ return local;
+ }
+
+ public void setLocal(InetAddress ip) {
+ local = ip;
+ }
+
+ public void setLocal(String localHost) {
+ try {
+ local = InetAddress.getByName(localHost);
+ } catch (UnknownHostException ex) {
+ }
+ }
+
+ private InetAddress remote = null;
+
+ public InetAddress getRemote() {
+ return remote;
+ }
+
+ public void setRemote(InetAddress ip) {
+ remote = ip;
+ }
+
+ public void host(String remoteHost) {
+ try {
+ remote = InetAddress.getByName(remoteHost);
+ } catch (UnknownHostException ex) {
+ }
+ }
+
+}</code></pre></div>
+
+ <p>The bean has two properties, both are of type <code>InetAddress</code>.
+ The first property <code>local</code> has an additional setter taking a
+ string argument. By default the Tomcat BeanFactory would try to use the
+ automatically detected setter with the same argument type as the property
+ type and then throw a NamingException, because it is not prepared to convert
+ the given string attribute value to <code>InetAddress</code>.
+ We can tell the Tomcat BeanFactory to use the other setter like that:</p>
+
+<div class="codeBox"><pre><code><Context ...>
+ ...
+ <Resource name="bean/MyBeanFactory" auth="Container"
+ type="com.mycompany.MyBean2"
+ factory="org.apache.naming.factory.BeanFactory"
+ forceString="local"
+ local="localhost"/>
+ ...
+</Context></code></pre></div>
+
+ <p>The bean property <code>remote</code> can also be set from a string,
+ but one has to use the non-standard method name <code>host</code>.
+ To set <code>local</code> and <code>remote</code> use the following
+ configuration:</p>
+
+<div class="codeBox"><pre><code><Context ...>
+ ...
+ <Resource name="bean/MyBeanFactory" auth="Container"
+ type="com.mycompany.MyBean2"
+ factory="org.apache.naming.factory.BeanFactory"
+ forceString="local,remote=host"
+ local="localhost"
+ remote="tomcat.apache.org"/>
+ ...
+</Context></code></pre></div>
+
+ <p>Multiple property descriptions can be combined in
+ <code>forceString</code> by concatenation with comma as a separator.
+ Each property description consists of either only the property name
+ in which case the BeanFactory calls the setter method. Or it consist
+ of <code>name=method</code> in which case the property named
+ <code>name</code> is set by calling method <code>method</code>.
+ For properties of types <code>String</code> or of primitive type
+ or of their associated primitive wrapper classes using
+ <code>forceString</code> is not needed. The correct setter will be
+ automatically detected and argument conversion will be applied.</p>
+
</blockquote></td></tr></table>
<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="UserDatabase Resources"><!--()--></a><a name="UserDatabase_Resources"><strong>UserDatabase Resources</strong></a></font></td></tr><tr><td><blockquote>
- <h3>0. Introduction</h3>
+ <h5>0. Introduction</h5>
<p>UserDatabase resources are typically configured as global resources for
- use by a UserDatabase realm. Tomcat includes a UserDatabaseFactoory that
+ use by a UserDatabase realm. Tomcat includes a UserDatabaseFactory that
creates UserDatabase resources backed by an XML file - usually
<code>tomcat-users.xml</code></p>
<p>The steps required to set up a global UserDatabase resource are described
below.</p>
- <h3>1. Create/edit the XML file</h3>
+ <h5>1. Create/edit the XML file</h5>
- <p>The XMl file is typically located at
+ <p>The XML file is typically located at
<code>$CATALINA_BASE/conf/tomcat-users.xml</code> however, you are free to
locate the file anywhere on the file system. It is recommended that the XML
files are placed in <code>$CATALINA_BASE/conf</code>. A typical XML would
look like:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<?xml version='1.0' encoding='utf-8'?>
+<div class="codeBox"><pre><code><?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-</tomcat-users>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</tomcat-users></code></pre></div>
- <h3>2. Declare Your Resource</h3>
+ <h5>2. Declare Your Resource</h5>
<p>Next, modify <code>$CATALINA_BASE/conf/server.xml</code> to create the
- UserDatabase resource based on your XMl file. It should look something like
+ UserDatabase resource based on your XML file. It should look something like
this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<Resource name="UserDatabase"
+<div class="codeBox"><pre><code><Resource name="UserDatabase"
auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"
- readonly="false" />
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+ readonly="false" /></code></pre></div>
- <p>The <code>pathname</code> attribute can be absolute or relative. If
- relative, it is relative to <code>$CATALINA_BASE</code>.</p>
-
+ <p>The <code>pathname</code> attribute can be a URL, an absolute path or a
+ relative path. If relative, it is relative to <code>$CATALINA_BASE</code>.
+ </p>
+
<p>The <code>readonly</code> attribute is optional and defaults to
<code>true</code> if not supplied. If the XML is writeable then it will be
written to when Tomcat starts. <strong>WARNING:</strong> When the file is
@@ -345,7 +518,7 @@
is running as. Ensure that these are appropriate to maintain the security
of your installation.</p>
- <h3>3. Configure the Realm</h3>
+ <h5>3. Configure the Realm</h5>
<p>Configure a UserDatabase Realm to use this resource as described in the
<a href="config/realm.html">Realm configuration documentation</a>.</p>
@@ -355,16 +528,16 @@
<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JavaMail Sessions"><!--()--></a><a name="JavaMail_Sessions"><strong>JavaMail Sessions</strong></a></font></td></tr><tr><td><blockquote>
- <h3>0. Introduction</h3>
+ <h5>0. Introduction</h5>
<p>In many web applications, sending electronic mail messages is a
required part of the system's functionality. The
- <a href="http://java.sun.com/products/javamail">Java Mail</a> API
+ <a href="http://www.oracle.com/technetwork/java/javamail/index.html">Java Mail</a> API
makes this process relatively straightforward, but requires many
configuration details that the client application must be aware of
(including the name of the SMTP host to be used for message sending).</p>
- <p>Tomcat 6 includes a standard resource factory that will create
+ <p>Tomcat includes a standard resource factory that will create
<code>javax.mail.Session</code> session instances for you, already
configured to connect to an SMTP server.
In this way, the application is totally insulated from changes in the
@@ -373,7 +546,7 @@
<p>The steps required for this are outlined below.</p>
- <h3>1. Declare Your Resource Requirements</h3>
+ <h5>1. Declare Your Resource Requirements</h5>
<p>The first thing you should do is modify the web application deployment
descriptor (<code>/WEB-INF/web.xml</code>) to declare the JNDI name under
@@ -382,8 +555,7 @@
standard <code>java:comp/env</code> naming context that is the root of
all provided resource factories. A typical <code>web.xml</code> entry
might look like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<resource-ref>
+<div class="codeBox"><pre><code><resource-ref>
<description>
Resource reference to a factory for javax.mail.Session
instances that may be used for sending electronic mail
@@ -399,8 +571,7 @@
<res-auth>
Container
</res-auth>
-</resource-ref>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</resource-ref></code></pre></div>
<p><strong>WARNING</strong> - Be sure you respect the element ordering
that is required by the DTD for web application deployment descriptors!
@@ -408,11 +579,10 @@
<a href="http://wiki.apache.org/tomcat/Specifications">Servlet
Specification</a> for details.</p>
- <h3>2. Code Your Application's Use Of This Resource</h3>
+ <h5>2. Code Your Application's Use Of This Resource</h5>
<p>A typical use of this resource reference might look like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-Context initCtx = new InitialContext();
+<div class="codeBox"><pre><code>Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
Session session = (Session) envCtx.lookup("mail/Session");
@@ -423,8 +593,7 @@
message.setRecipients(Message.RecipientType.TO, to);
message.setSubject(request.getParameter("subject"));
message.setContent(request.getParameter("content"), "text/plain");
-Transport.send(message);
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+Transport.send(message);</code></pre></div>
<p>Note that the application uses the same resource reference name
that was declared in the web application deployment descriptor. This
@@ -432,21 +601,19 @@
<a href="config/context.html"><code><Context></code></a> element
for the web application as described below.</p>
- <h3>3. Configure Tomcat's Resource Factory</h3>
+ <h5>3. Configure Tomcat's Resource Factory</h5>
<p>To configure Tomcat's resource factory, add an elements like this to the
<a href="config/context.html"><code><Context></code></a> element for
this web application.</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<Context ...>
+<div class="codeBox"><pre><code><Context ...>
...
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/>
...
-</Context>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</Context></code></pre></div>
<p>Note that the resource name (here, <code>mail/Session</code>) must
match the value specified in the web application deployment descriptor.
@@ -458,31 +625,33 @@
<code>javax.mail.Session.getInstance(java.util.Properties)</code> as part of
the <code>java.util.Properties</code> collection. In addition to the
properties defined in Annex A of the JavaMail specification, individual
- providers may also support additional properties.</p>
+ providers may also support additional properties.
+ </p>
- <p>Tomcat's resource factory provides a <code>password</code> property
- which can be configured by adding <code>password="yourpassword"</code>
- to the Resource definition.</p>
+ <p>If the resource is configured with a <code>password</code> attribute and
+ either a <code>mail.smtp.user</code> or <code>mail.user</code> attribute
+ then Tomcat's resource factory will configure and add a
+ <code>javax.mail.Authenticator</code> to the mail session.</p>
- <h3>4. Install the JavaMail libraries</h3>
+ <h5>4. Install the JavaMail libraries</h5>
- <p><a href="http://www.oracle.com/technetwork/java/index-138643.html">
- Download the JavaMail API</a>. The JavaMail API requires the Java Activation
- Framework (JAF) API as well. The Java Activation Framework is included in
- Java SE 6 onwards. Java SE 5 users can download the latest version,
- <a href="http://www.oracle.com/technetwork/java/javase/downloads/index-135046.html">
- JAF 1.1.1</a>.
+ <p><a href="http://javamail.java.net/">
+ Download the JavaMail API</a>.</p>
+
+ <p>Unpackage the distribution and place mail.jar into $CATALINA_HOME/lib so
+ that it is available to Tomcat during the initialization of the mail Session
+ Resource. <strong>Note:</strong> placing this jar in both $CATALINA_HOME/lib
+ and a web application's lib folder will cause an error, so ensure you have
+ it in the $CATALINA_HOME/lib location only.
</p>
- <p>Unpackage the distribution(s) and place mail.jar (and activation.jar if
- required) into $CATALINA_HOME/lib so the JAR(s) is(are) available to Tomcat
- during the initialization of the mail Session Resource.
- <strong>Note:</strong> placing jars in both $CATALINA_HOME/lib and a web
- application's lib folder will cause an error, so ensure mail.jar (and
- activation.jar) is(are) placed only the $CATALINA_HOME/lib location.
- </p>
+ <h5>5. Restart Tomcat</h5>
- <h3>Example Application</h3>
+ <p>For the additional JAR to be visible to Tomcat, it is necessary for the
+ Tomcat instance to be restarted.</p>
+
+
+ <h5>Example Application</h5>
<p>The <code>/examples</code> application included with Tomcat contains
an example of utilizing this resource factory. It is accessed via the
@@ -502,29 +671,31 @@
<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JDBC Data Sources"><!--()--></a><a name="JDBC_Data_Sources"><strong>JDBC Data Sources</strong></a></font></td></tr><tr><td><blockquote>
- <h3>0. Introduction</h3>
+ <h5>0. Introduction</h5>
<p>Many web applications need to access a database via a JDBC driver,
- to support the functionality required by that application. The J2EE
- Platform Specification requires J2EE Application Servers to make
+ to support the functionality required by that application. The Java EE
+ Platform Specification requires Java EE Application Servers to make
available a <em>DataSource</em> implementation (that is, a connection
- pool for JDBC connections) for this purpose. Tomcat 6 offers exactly
+ pool for JDBC connections) for this purpose. Tomcat offers exactly
the same support, so that database-based applications you develop on
- Tomcat using this service will run unchanged on any J2EE server.</p>
+ Tomcat using this service will run unchanged on any Java EE server.</p>
<p>For information about JDBC, you should consult the following:</p>
<ul>
- <li><a href="http://java.sun.com/products/jdbc/">http://java.sun.com/products/jdbc/</a> -
+ <li><a href="http://www.oracle.com/technetwork/java/javase/jdbc/index.html">
+ http://www.oracle.com/technetwork/java/javase/jdbc/index.html</a> -
Home page for information about Java Database Connectivity.</li>
- <li><a href="http://docs.oracle.com/javase/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html">http://docs.oracle.com/javase/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html</a> -
+ <li><a href="http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html">http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame.html</a> -
The JDBC 2.1 API Specification.</li>
<li><a href="http://java.sun.com/products/jdbc/jdbc20.stdext.pdf">http://java.sun.com/products/jdbc/jdbc20.stdext.pdf</a> -
The JDBC 2.0 Standard Extension API (including the
<code>javax.sql.DataSource</code> API). This package is now known
as the "JDBC Optional Package".</li>
- <li><a href="http://java.sun.com/j2ee/download.html">http://java.sun.com/j2ee/download.html</a> -
- The J2EE Platform Specification (covers the JDBC facilities that
- all J2EE platforms must provide to applications).</li>
+ <li><a href="http://www.oracle.com/technetwork/java/javaee/overview/index.htm">
+ http://www.oracle.com/technetwork/java/javaee/overview/index.htm</a> -
+ The Java EE Platform Specification (covers the JDBC facilities that
+ all Java EE platforms must provide to applications).</li>
</ul>
<p><strong>NOTE</strong> - The default data source support in Tomcat
@@ -533,9 +704,9 @@
project. However, it is possible to use any other connection pool
that implements <code>javax.sql.DataSource</code>, by writing your
own custom resource factory, as described
- <a href="#Adding Custom Resource Factories">below</a>.</p>
+ <a href="#Adding_Custom_Resource_Factories">below</a>.</p>
- <h3>1. Install Your JDBC Driver</h3>
+ <h5>1. Install Your JDBC Driver</h5>
<p>Use of the <em>JDBC Data Sources</em> JNDI Resource Factory requires
that you make an appropriate JDBC driver available to both Tomcat internal
@@ -544,7 +715,7 @@
<code>$CATALINA_HOME/lib</code> directory, which makes the driver
available both to the resource factory and to your application.</p>
- <h3>2. Declare Your Resource Requirements</h3>
+ <h5>2. Declare Your Resource Requirements</h5>
<p>Next, modify the web application deployment descriptor
(<code>/WEB-INF/web.xml</code>) to declare the JNDI name under
@@ -553,13 +724,12 @@
standard <code>java:comp/env</code> naming context that is the root of
all provided resource factories. A typical <code>web.xml</code> entry
might look like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<resource-ref>
+<div class="codeBox"><pre><code><resource-ref>
<description>
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the <Context>
- configurartion for the web application.
+ configuration for the web application.
</description>
<res-ref-name>
jdbc/EmployeeDB
@@ -570,8 +740,7 @@
<res-auth>
Container
</res-auth>
-</resource-ref>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</resource-ref></code></pre></div>
<p><strong>WARNING</strong> - Be sure you respect the element ordering
that is required by the DTD for web application deployment descriptors!
@@ -579,19 +748,17 @@
<a href="http://wiki.apache.org/tomcat/Specifications">Servlet
Specification</a> for details.</p>
- <h3>3. Code Your Application's Use Of This Resource</h3>
+ <h5>3. Code Your Application's Use Of This Resource</h5>
<p>A typical use of this resource reference might look like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-Context initCtx = new InitialContext();
+<div class="codeBox"><pre><code>Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)
envCtx.lookup("jdbc/EmployeeDB");
Connection conn = ds.getConnection();
... use this connection to access the database ...
-conn.close();
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+conn.close();</code></pre></div>
<p>Note that the application uses the same resource reference name that was
declared in the web application deployment descriptor. This is matched up
@@ -599,14 +766,13 @@
<a href="config/context.html"><code><Context></code></a> element for
the web application as described below.</p>
- <h3>4. Configure Tomcat's Resource Factory</h3>
+ <h5>4. Configure Tomcat's Resource Factory</h5>
<p>To configure Tomcat's resource factory, add an element like this to the
<a href="config/context.html"><code><Context></code></a> element for
the web application.</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<Context ...>
+<div class="codeBox"><pre><code><Context ...>
...
<Resource name="jdbc/EmployeeDB"
auth="Container"
@@ -618,8 +784,7 @@
maxActive="8"
maxIdle="4"/>
...
-</Context>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</Context></code></pre></div>
<p>Note that the resource name (here, <code>jdbc/EmployeeDB</code>) must
match the value specified in the web application deployment descriptor.</p>
@@ -671,7 +836,7 @@
returned to the pool. Default: false</li>
</ul>
<p>The optional evictor thread is responsible for shrinking the pool
- by removing any conections which are idle for a long time. The evictor
+ by removing any connections which are idle for a long time. The evictor
does not respect <code>minIdle</code>. Note that you do not need to
activate the evictor thread if you only want the pool to shrink according
to the configured <code>maxIdle</code> property.</p>
@@ -682,7 +847,7 @@
milliseconds between consecutive runs of the evictor.
Default: -1 (disabled)</li>
<li><strong>numTestsPerEvictionRun</strong> - The number of connections
- that will be checked for idleness by the evitor during each
+ that will be checked for idleness by the evictor during each
run of the evictor. Default: 3</li>
<li><strong>minEvictableIdleTimeMillis</strong> - The idle time in
milliseconds after which a connection can be removed from the pool
@@ -746,21 +911,23 @@
</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Adding Custom Resource Factories"><!--()--></a><a name="Adding_Custom_Resource_Factories"><strong>Adding Custom Resource Factories</strong></a></font></td></tr><tr><td><blockquote>
<p>If none of the standard resource factories meet your needs, you can write
- your own factory and integrate it into Tomcat 6, and then configure the use
+ your own factory and integrate it into Tomcat, and then configure the use
of this factory in the
<a href="config/context.html"><code><Context></code></a> element for
the web application. In the example below, we will create a factory that only
knows how to create <code>com.mycompany.MyBean</code> beans from the
- <a href="#Generic JavaBean Resources">Generic JavaBean Resources</a> example
+ <a href="#Generic_JavaBean_Resources">Generic JavaBean Resources</a> example
above.</p>
- <h3>1. Write A Resource Factory Class</h3>
+ <h4>1. Write A Resource Factory Class</h4>
<p>You must write a class that implements the JNDI service provider
- <code>javax.naming.spi.ObjectFactory</code> inteface. Every time your
+ <code>javax.naming.spi.ObjectFactory</code> interface. Every time your
web application calls <code>lookup()</code> on a context entry that is
- bound to this factory, the <code>getObjectInstance()</code> method is
- called, with the following arguments:</p>
+ bound to this factory (assuming that the factory is configured with
+ <code>singleton="false"</code>), the
+ <code>getObjectInstance()</code> method is called, with the following
+ arguments:</p>
<ul>
<li><strong>Object obj</strong> - The (possibly null) object containing
location or reference information that can be used in creating an object.
@@ -783,8 +950,7 @@
<p>To create a resource factory that knows how to produce <code>MyBean</code>
instances, you might create a class like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-package com.mycompany;
+<div class="codeBox"><pre><code>package com.mycompany;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -798,7 +964,7 @@
public class MyBeanFactory implements ObjectFactory {
public Object getObjectInstance(Object obj,
- Name name, Context nameCtx, Hashtable environment)
+ Name name2, Context nameCtx, Hashtable environment)
throws NamingException {
// Acquire an instance of our specified bean class
@@ -827,8 +993,7 @@
}
-}
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+}</code></pre></div>
<p>In this example, we are unconditionally creating a new instance of
the <code>com.mycompany.MyBean</code> class, and populating its properties
@@ -840,8 +1005,8 @@
bean being configured.</p>
<p>For more information about <code>ObjectFactory</code>, see the
- <a href="http://java.sun.com/products/jndi/docs.html">JNDI 1.2 Service
- Provider Interface (SPI) Specification</a>.</p>
+ <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/index.html">
+ JNDI Service Provider Interface (SPI) Specification</a>.</p>
<p>You will need to compile this class against a class path that includes
all of the JAR files in the <code>$CATALINA_HOME/lib</code> directory. When you are through,
@@ -851,15 +1016,14 @@
files are visible to both Catalina internal resources and your web
application.</p>
- <h3>2. Declare Your Resource Requirements</h3>
+ <h4>2. Declare Your Resource Requirements</h4>
<p>Next, modify your web application deployment descriptor
(<code>/WEB-INF/web.xml</code>) to declare the JNDI name under which
you will request new instances of this bean. The simplest approach is
to use a <code><resource-env-ref></code> element, like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<resource-env-ref>
+<div class="codeBox"><pre><code><resource-env-ref>
<description>
Object factory for MyBean instances.
</description>
@@ -869,8 +1033,7 @@
<resource-env-ref-type>
com.mycompany.MyBean
</resource-env-ref-type>
-<resource-env-ref>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</resource-env-ref></code></pre></div>
<p><strong>WARNING</strong> - Be sure you respect the element ordering
that is required by the DTD for web application deployment descriptors!
@@ -878,36 +1041,33 @@
<a href="http://wiki.apache.org/tomcat/Specifications">Servlet
Specification</a> for details.</p>
- <h3>3. Code Your Application's Use Of This Resource</h3>
+ <h4>3. Code Your Application's Use Of This Resource</h4>
<p>A typical use of this resource environment reference might look
like this:</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-Context initCtx = new InitialContext();
+<div class="codeBox"><pre><code>Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
MyBean bean = (MyBean) envCtx.lookup("bean/MyBeanFactory");
writer.println("foo = " + bean.getFoo() + ", bar = " +
- bean.getBar());
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+ bean.getBar());</code></pre></div>
- <h3>4. Configure Tomcat's Resource Factory</h3>
+ <h4>4. Configure Tomcat's Resource Factory</h4>
<p>To configure Tomcat's resource factory, add an elements like this to the
<a href="config/context.html"><code><Context></code></a> element for
this web application.</p>
-<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
-<Context ...>
+<div class="codeBox"><pre><code><Context ...>
...
<Resource name="bean/MyBeanFactory" auth="Container"
type="com.mycompany.MyBean"
factory="com.mycompany.MyBeanFactory"
+ singleton="false"
bar="23"/>
...
-</Context>
-</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
+</Context></code></pre></div>
<p>Note that the resource name (here, <code>bean/MyBeanFactory</code>
must match the value specified in the web application deployment
@@ -926,6 +1086,31 @@
modify applications using the resources, as long as you maintain
compatible APIs.</p>
-</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
- Copyright © 1999-2014, Apache Software Foundation
+</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This comments section collects your suggestions
+ on improving documentation for Apache Tomcat.<br><br>
+ If you have trouble and need help, read
+ <a href="http://tomcat.apache.org/findhelp.html">Find Help</a> page
+ and ask your question on the tomcat-users
+ <a href="http://tomcat.apache.org/lists.html">mailing list</a>.
+ Do not ask such questions here. This is not a Q&A section.<br><br>
+ The Apache Comments System is explained <a href="./comments.html">here</a>.
+ Comments may be removed by our moderators if they are either
+ implemented or considered invalid/off-topic.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
+ var comments_shortname = 'tomcat';
+ var comments_identifier = 'http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html';
+ (function(w, d) {
+ if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
+ d.write('<div id="comments_thread"><\/div>');
+ var s = d.createElement('script');
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+ (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+ }
+ else {
+ d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.<\/strong><\/div>');
+ }
+ })(window, document);
+ //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
+ Copyright © 1999-2017, Apache Software Foundation
</em></font></div></td></tr></table></body></html>
\ No newline at end of file