Global Resources are a little confusing.  Declaring a resource in the
GlobalNamingResources section of the server.xml doesn't make the
resource visible to webapps until the context for the webapp includes
a ResourceLink.  This obscurity is for security.  

It seems weird to declare something 'global' and have it visible
nowhere.  (until it is linked.)  Tempting to call a
"GlobalNamingResources" a "HiddenGlobalNamingResources" or
"BackgroundGlobalNamingResources" or "MightBeGlobalNamingResources"

In any event, I tried to update "globalresources.xml" to refer to the
needed ResourceLink so developers don't get tripped up on the
documentation.  I am not sure I am happy with my exact text.  Remmy,
what do you think?

Cheers,
-bob


Index: globalresources.xml
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/webapps/tomcat-docs/config/globalresources.xml,v
retrieving revision 1.1
diff -u -r1.1 globalresources.xml
--- globalresources.xml 30 Nov 2001 06:23:13 -0000      1.1
+++ globalresources.xml 3 Jun 2002 22:20:50 -0000
@@ -51,7 +51,19 @@
 </GlobalNamingResources>
 </source>
 
-    <p>This is equivalent to the inclusion of the following element in the
+    <p>You must then make the this global setting visible to the context by using a 
+<a href="context.html#Resource Links">Resource Link</a>, like this:</p>
+
+<source>
+&lt;Context ...&gt;
+  ...
+  &lt;ResourceLink name="maxExemptions"
+            global="maxExemptions"
+            type="java.lang.Integer"/&gt;
+  ...
+&lt;/Context&gt;
+</source>
+
+    <p>This is then equivalent to the inclusion of the following element in the
     web application deployment descriptor (<code>/WEB-INF/web.xml</code>):
     </p>
 <source>
@@ -129,7 +141,19 @@
 &lt;/GlobalNamingResources&gt;
 </source>
 
-    <p>This is equivalent to the inclusion of the following element in the
+    <p>You must then make the this global setting visible to the context by using a 
+<a href="context.html#Resource Links">Resource Link</a>, like this:</p>
+
+<source>
+&lt;Context ...&gt;
+  ...
+  &lt;ResourceLink name="jdbc/EmployeeDB"
+            global="jdbc/EmployeeDB"
+            type="javax.sql.DataSource"/&gt;
+  ...
+&lt;/Context&gt;
+</source>
+
+    <p>This is then equivalent to the inclusion of the following element in the
     web application deployment descriptor (<code>/WEB-INF/web.xml</code>):</p>
 <source>
 &lt;resource-ref&gt;


Cheers,
-bob

Cheers,
-bob

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to