source: nutchez-0.1/tomcat/webapps/docs/config/printer/globalresources.html @ 95

Last change on this file since 95 was 66, checked in by waue, 16 years ago

NutchEz - an easy way to nutch

File size: 18.4 KB
RevLine 
[66]1<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat Configuration Reference - The GlobalNamingResources Component</title><meta value="Remy Maucherat" name="author"><meta value="remm@apache.org" name="email"><meta value="Yoav Shapira" name="author"><meta value="yoavs@apache.org" name="email"></head><body vlink="#525D76" alink="#525D76" link="#525D76" text="#000000" bgcolor="#ffffff"><table cellspacing="0" width="100%" border="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img border="0" alt="
2    The Apache Tomcat Servlet/JSP Container
3  " align="right" src="../../images/tomcat.gif"></a></td><td><font face="arial,helvetica,sanserif"><h1>Apache Tomcat 6.0</h1></font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img border="0" alt="Apache Logo" align="right" src="../../images/asf-logo.gif"></a></td></tr></table><table cellspacing="4" width="100%" border="0"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><tr><!--RIGHT SIDE MAIN BODY--><td align="left" valign="top" width="80%"><table cellspacing="4" width="100%" border="0"><tr><td valign="top" align="left"><h1>Apache Tomcat Configuration Reference</h1><h2>The GlobalNamingResources Component</h2></td><td nowrap="true" valign="top" align="right"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
4
5  <p>The <strong>GlobalNamingResources</strong> element defines the global
6  JNDI resources for the <a href="server.html">Server</a>.</p>
7
8  <p>These resources are listed in the server's global JNDI resource context.
9   This context is distinct from the per-web-application JNDI contexts
10  described in
11  the <a href="../../jndi-resources-howto.html">JNDI Resources HOW-TO</a>.
12  The resources defined in this element are <strong>not</strong> visible in
13  the per-web-application contexts unless you explicitly link them with
14  <a href="context.html#Resource Links">&lt;ResourceLink&gt;</a> elements.
15  </p>
16
17</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>
18
19</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Nested Components"><strong>Nested Components</strong></a></font></td></tr><tr><td><blockquote>
20
21</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Special Features"><strong>Special Features</strong></a></font></td></tr><tr><td><blockquote>
22
23
24  <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Environment Entries"><strong>Environment Entries</strong></a></font></td></tr><tr><td><blockquote>
25
26  <p>You can configure named values that will be made visible to all
27    web applications as environment entry resources by nesting
28    <code>&lt;Environment&gt;</code> entries inside this element. For
29    example, you can create an environment entry like this:</p>
30<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre>
31&lt;GlobalNamingResources ...&gt;
32  ...
33  &lt;Environment name="maxExemptions" value="10"
34         type="java.lang.Integer" override="false"/&gt;
35  ...
36&lt;/GlobalNamingResources&gt;
37</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div>
38
39    <p>This is equivalent to the inclusion of the following element in the
40    web application deployment descriptor (<code>/WEB-INF/web.xml</code>):
41    </p>
42<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre>
43&lt;env-entry&gt;
44  &lt;env-entry-name&gt;maxExemptions&lt;/env-entry-name&gt;
45  &lt;env-entry-value&gt;10&lt;/env-entry-value&gt;
46  &lt;env-entry-type&gt;java.lang.Integer&lt;/env-entry-type&gt;
47&lt;/env-entry&gt;
48</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div>
49    <p>but does <em>not</em> require modification of the deployment descriptor
50    to customize this value.</p>
51
52    <p>The valid attributes for an <code>&lt;Environment&gt;</code> element
53    are as follows:</p>
54
55    <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><code>description</code></td><td valign="center" align="left">
56        <p>Optional, human-readable description of this environment entry.</p>
57      </td></tr><tr><td valign="center" align="left"><strong><code>name</code></strong></td><td valign="center" align="left">
58        <p>The name of the environment entry to be created, relative to the
59        <code>java:comp/env</code> context.</p>
60      </td></tr><tr><td valign="center" align="left"><code>override</code></td><td valign="center" align="left">
61        <p>Set this to <code>false</code> if you do <strong>not</strong> want
62        an <code>&lt;env-entry&gt;</code> for the same environment entry name,
63        found in the web application deployment descriptor, to override the
64        value specified here.  By default, overrides are allowed.</p>
65      </td></tr><tr><td valign="center" align="left"><strong><code>type</code></strong></td><td valign="center" align="left">
66        <p>The fully qualified Java class name expected by the web application
67        for this environment entry.  Must be one of the legal values for
68        <code>&lt;env-entry-type&gt;</code> in the web application deployment
69        descriptor:  <code>java.lang.Boolean</code>,
70        <code>java.lang.Byte</code>, <code>java.lang.Character</code>,
71        <code>java.lang.Double</code>, <code>java.lang.Float</code>,
72        <code>java.lang.Integer</code>, <code>java.lang.Long</code>,
73        <code>java.lang.Short</code>, or <code>java.lang.String</code>.</p>
74      </td></tr><tr><td valign="center" align="left"><strong><code>value</code></strong></td><td valign="center" align="left">
75        <p>The parameter value that will be presented to the application
76        when requested from the JNDI context.  This value must be convertable
77        to the Java type defined by the <code>type</code> attribute.</p>
78      </td></tr></table>
79
80  </blockquote></td></tr></table>
81
82
83  <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Resource Definitions"><strong>Resource Definitions</strong></a></font></td></tr><tr><td><blockquote>
84
85    <p>You can declare the characteristics of resources
86    to be returned for JNDI lookups of <code>&lt;resource-ref&gt;</code> and
87    <code>&lt;resource-env-ref&gt;</code> elements in the web application
88    deployment descriptor by defining them in this element and then linking
89    them with <a href="context.html#Resource Links">&lt;ResourceLink&gt;</a> 
90    elements
91    in the <code><strong>&lt;Context&gt;</strong></code> element. 
92
93    You <strong>MUST</strong> also define any other needed parameters using
94    attributes on the Resource element, to configure
95    the object factory to be used (if not known to Tomcat already), and
96    the properties used to configure that object factory.</p>
97
98    <p>For example, you can create a resource definition like this:</p>
99<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre>
100&lt;GlobalNamingResources ...&gt;
101  ...
102  &lt;Resource name="jdbc/EmployeeDB" auth="Container"
103            type="javax.sql.DataSource"
104     description="Employees Database for HR Applications"/&gt;
105  ...
106&lt;/GlobalNamingResources&gt;
107</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div>
108
109    <p>This is equivalent to the inclusion of the following element in the
110    web application deployment descriptor (<code>/WEB-INF/web.xml</code>):</p>
111<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre>
112&lt;resource-ref&gt;
113  &lt;description&gt;Employees Database for HR Applications&lt;/description&gt;
114  &lt;res-ref-name&gt;jdbc/EmployeeDB&lt;/res-ref-name&gt;
115  &lt;res-ref-type&gt;javax.sql.DataSource&lt;/res-ref-type&gt;
116  &lt;res-auth&gt;Container&lt;/res-auth&gt;
117&lt;/resource-ref&gt;
118</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div>
119
120    <p>but does <em>not</em> require modification of the deployment
121    descriptor to customize this value.</p>
122
123    <p>The valid attriutes for a <code>&lt;Resource&gt;</code> element
124    are as follows:</p>
125
126    <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><code>auth</code></td><td valign="center" align="left">
127        <p>Specify whether the web Application code signs on to the
128        corresponding resource manager programatically, or whether the
129        Container will sign on to the resource manager on behalf of the
130        application.  The value of this attribute must be
131        <code>Application</code> or <code>Container</code>.  This
132        attribute is <strong>required</strong> if the web application
133        will use a <code>&lt;resource-ref&gt;</code> element in the web
134        application deployment descriptor, but is optional if the
135        application uses a <code>&lt;resource-env-ref&gt;</code> instead.</p>
136      </td></tr><tr><td valign="center" align="left"><code>description</code></td><td valign="center" align="left">
137        <p>Optional, human-readable description of this resource.</p>
138      </td></tr><tr><td valign="center" align="left"><strong><code>name</code></strong></td><td valign="center" align="left">
139        <p>The name of the resource to be created, relative to the
140        <code>java:comp/env</code> context.</p>
141      </td></tr><tr><td valign="center" align="left"><code>scope</code></td><td valign="center" align="left">
142        <p>Specify whether connections obtained through this resource
143        manager can be shared.  The value of this attribute must be
144        <code>Shareable</code> or <code>Unshareable</code>.  By default,
145        connections are assumed to be shareable.</p>
146      </td></tr><tr><td valign="center" align="left"><strong><code>type</code></strong></td><td valign="center" align="left">
147        <p>The fully qualified Java class name expected by the web
148        application when it performs a lookup for this resource.</p>
149      </td></tr></table>
150
151
152  </blockquote></td></tr></table>
153
154  <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Resource Links"><strong>Resource Links</strong></a></font></td></tr><tr><td><blockquote>
155    <p>Use <a href="context.html#Resource Links">&lt;ResourceLink&gt;</a> 
156    elements to link resources from the global context into
157    per-web-application contexts. Here is an example of making a custom
158    factory available to all applications in the server, based on the example
159    definition in the
160    <a href="../../jndi-resources-howto.html#Generic JavaBean Resources">
161    JNDI Resource HOW-TO</a>:
162    </p>
163
164    <div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre>
165     
166        &lt;DefaultContext&gt;
167          &lt;ResourceLink
168            name="bean/MyBeanFactory"
169            global="bean/MyBeanFactory"
170            type="com.mycompany.MyBean"
171          /&gt;
172        &lt;/DefaultContext&gt;
173     
174    </pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" src="../../images/void.gif"></td></tr></table></div>
175
176   </blockquote></td></tr></table>
177
178  <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Transaction"><strong>Transaction</strong></a></font></td></tr><tr><td><blockquote>
179
180    <p>You can declare the characteristics of the UserTransaction
181    to be returned for JNDI lookup for <code>java:comp/UserTransaction</code>.
182    You <strong>MUST</strong> define an object factory class to instantiate
183    this object as well as the needed resource parameters as attributes of the
184    <code>Transaction</code> 
185    element, and the properties used to configure that object factory.</p>
186
187    <p>The valid attributes for the <code>&lt;Transaction&gt;</code> element
188    are as follows:</p>
189
190    <table cellpadding="5" border="1"><tr><th bgcolor="#023264" width="15%"><font color="#ffffff">Attribute</font></th><th bgcolor="#023264" width="85%"><font color="#ffffff">Description</font></th></tr><tr><td valign="center" align="left"><strong><code>factory</code></strong></td><td valign="center" align="left">
191        <p>The class name for the JNDI object factory.</p>
192      </td></tr></table>
193
194  </blockquote></td></tr></table>
195
196</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em>
197        Copyright &copy; 1999-2008, Apache Software Foundation
198        </em></font></div></td></tr></table></body></html>
Note: See TracBrowser for help on using the repository browser.