tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1401503 [4/4] - in /tomcat/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/mapper/ java/org/apache/catalina/servlets/ java/org/apache/catalina/startup/ java/org/a...
Date Tue, 23 Oct 2012 22:38:18 GMT
Modified: tomcat/trunk/webapps/docs/config/context.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1401503&r1=1401502&r2=1401503&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/trunk/webapps/docs/config/context.xml Tue Oct 23 22:38:16 2012
@@ -530,30 +530,6 @@
         </p>
       </attribute>
 
-      <attribute name="aliases" required="false">
-        <p>This attribute provides a list of external locations from which to
-        load resources for this context. The list of aliases should be of
-        the form <code>"/aliasPath1=docBase1,/aliasPath2=docBase2"</code> where
-        <code>aliasPathN</code> must include a leading '/' and
-        <code>docBaseN</code> must be an absolute path to either a .war file
or
-        a directory.</p>
-        <p>Whitespace is permitted around both the <code>,</code> and
-        <code>=</code> delimiters, and will be trimmed. Therefore, an aliases
-        attribute with the value <code>"/aliasPath1 = docBase1,<br/>
-        /aliasPath2= docBase2"</code> is equivalent to
-        <code>"/aliasPath1=docBase1,/aliasPath2=docBase2"</code></p>
-        <p>A resource will be searched for in the first <code>docBaseN</code>
-        for which <code>aliasPathN</code> is a leading path segment of the
-        resource. If there is no such alias, then the resource will be searched
-        in the usual way.</p>
-        <p>Using '/' as an aliasPath is not allowed. Consider using
-        <code>docBase</code> instead.</p>
-        <p>These external locations will not be emptied if the context
-        is un-deployed.</p>
-        <p>A more powerful feature (for development only) is
-        <a href="#Virtual_webapp">Virtual webapp</a>.</p>
-      </attribute>
-
       <attribute name="allowLinking" required="false">
         <p>If the value of this flag is <code>true</code>, symlinks will
be
         allowed inside the web application, pointing to resources outside the
@@ -1276,94 +1252,6 @@ for details.</p>
 
   </subsection>
 
-  <subsection name="Virtual webapp">
-    <p>During development it may be more productive to avoid copying files (static
-    resources, JSPs, classes, jars...) and configure tomcat to use files from their
-    source locations. To do that, several customisations of the context configuration are
-    required:</p>
-    <ul>
-      <li>The <code>VirtualDirContext</code> implementation of
-      <a href="resources.html">Resources</a></li>
-      <li>The <code>VirtualWebappLoader</code> implementation of
-      <a href="loader.html">Loader</a></li>
-      <li><code>scanAllDirectories="true"</code> on the <a href="jar-scanner.html">JarScanner</a></li>
-    </ul>
-    <p>To illustrate this feature, here is an example of a standard maven webapp source
tree:</p>
-<source>
-mywebapp/
-         src/
-             main/
-                  java/
-                  resources/
-                  webapp/
-                         WEB-INF/
-                                 classes/
-         target/
-                classes/
-</source>
-    <p>To deploy such an application (assuming it also uses the log4j maven artefact),
-    the context configuration looks like:</p>
-<source>
-&lt;Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" >
-  &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
-    extraResourcePaths=
-      "/WEB-INF/classes=/Users/theuser/mywebapp/target/classes" />
-  &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
-    virtualClasspath="/Users/theuser/mywebapp/target/classes;
-      /Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar" />
-  &lt;JarScanner scanAllDirectories="true" />
-&lt;/Context>
-</source>
-
-    <p>Here is another example where the webapp serves pictures under /pictures and
movies
-    under /movies and also depends on another maven project mylib that would normally
-    produce a jar to be packaged in WEB-INF/lib:</p>
-<source>
-mylib/
-      src/
-          main/
-               java/
-               resources/
-                         META-INF/
-                                  resources/
-      target/
-             classes/
-mymovies/
-mypictures/
-mywebapp/
-         src/
-             main/
-                  java/
-                  resources/
-                  webapp/
-                         WEB-INF/
-                                 classes/
-         target/
-                classes/
-</source>
-    <p>The configuration is:</p>
-
-<source wrapped="true">
-&lt;Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" >
-<indent>
-  &lt;Resources className="org.apache.naming.resources.VirtualDirContext"
-    <indent><outdent>extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"</outdent></indent>
-    <indent>/></indent>
-</indent>
-<indent>
-  &lt;Loader className="org.apache.catalina.loader.VirtualWebappLoader"
-    <indent><outdent>virtualClasspath="/Users/theuser/mywebapp/target/classes;/Users/theuser/mylib/target/classes;/Users/theuser/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar"</outdent></indent>
-    <indent>/></indent>
-</indent>
-<indent>
-  &lt;JarScanner scanAllDirectories="true" />
-</indent>
-&lt;/Context>
-</source>
-
-    <p>Note that resources in mylib/target/classes/META-INF/resources/ are mapped to
/ as
-    required by servlet 3 specification.</p>
-  </subsection>
 </section>
 
 

Modified: tomcat/trunk/webapps/docs/config/loader.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/loader.xml?rev=1401503&r1=1401502&r2=1401503&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/loader.xml (original)
+++ tomcat/trunk/webapps/docs/config/loader.xml Tue Oct 23 22:38:16 2012
@@ -140,43 +140,6 @@
 
   </subsection>
 
-  <subsection name="VirtualWebappLoader Implementation">
-
-    <p>This implementation of <strong>Loader</strong> is
-    <strong>org.apache.catalina.loader.VirtualWebappLoader</strong>.
-    It extends <code>WebappLoader</code> and supports the following
-    additional attributes</p>
-
-    <attributes>
-
-      <attribute name="virtualClasspath" required="false">
-        <p>Additional repositories to search for resources.
-        Multiple values can be joined using <code>;</code>
-        as a separator.</p>
-        <p>Leading and trailing whitespaces in values are ignored.
-        If a value does not point to an existing directory or
-        <code>*.jar</code> file, it is silently skipped.
-        Diagnostic messages can be seen if you enable debug logging for
-        the VirtualWebappLoader class.
-        </p>
-        <p>Example: <code>virtualClasspath=&quot;${catalina.base}/myapp_config&quot;</code></p>
-      </attribute>
-
-      <attribute name="searchVirtualFirst" required="false">
-        <p>Set to <code>true</code> if you want the virtual
-        class path to be searched before
-        <code>WEB-INF/classes</code> and <code>WEB-INF/lib</code>.
-        Default value is <code>false</code>.</p>
-        <p>If searched before, resources located in the virtual
-        class path take precendence over resources with the same
-        name contained in the webapp.</p>
-      </attribute>
-
-    </attributes>
-
-  </subsection>
-
-
 </section>
 
 

Modified: tomcat/trunk/webapps/docs/config/resources.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/resources.xml?rev=1401503&r1=1401502&r2=1401503&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/resources.xml (original)
+++ tomcat/trunk/webapps/docs/config/resources.xml Tue Oct 23 22:38:16 2012
@@ -23,30 +23,28 @@
   &project;
 
   <properties>
-    <author email="remm@apache.org">Remy Maucherat</author>
     <title>The Resources Component</title>
   </properties>
 
 <body>
 
 <section name="Table of Contents">
-<toc/>
+<toc />
 </section>
 
 <section name="Introduction">
 
-  <p>The <strong>Resources</strong> element represents the <em>web
-  application static resources</em>, from which classes will be loaded,
-  HTML, JSP and the other static files will be served. This allows the webapp
-  to reside on various mediums other than the filesystem, like compressed
-  in a WAR file, in a JDBC database, or in a more advanced versioning
+  <p>The <strong>Resources</strong> element represents all the resources
+  available to the web application. This includes classes, JAR files, HTML, JSPs
+  and any other files that contribute to the web application. Implementations
+  are provided to use directories, JAR files and WARs as the source of these
+  resources and the resources implementation may be extended to provide support
+  for files stored in other forms such as in a database or a versioned
   repository.</p>
 
-  <p>A unified caching engine is provided for all accesses to the webapp
-  resources made by the servlet container and web applications which use the
-  container provided mechanisms to access such resources, such as classloader
-  access, access through the <code>ServletContext</code> interface, or native
-  access through the <code>DirectoryContext</code> interface.</p>
+  <p>Resources are cached by default. Caching may be controlled by configuring
+  the appropriate caching attributes on the containing <a href="context.html">
+  Context</a>.</p>
 
   <p><strong>Note: Running a webapp with non-filesystem based
   Resources implementations is only possible when the webapp does not
@@ -71,14 +69,10 @@
     <attributes>
 
       <attribute name="className" required="false">
-        <p>Java class name of the implementation to use.  This class must
-        implement the <code>javax.naming.directory.DirContext</code> interface.
-        It is recommended for optimal functionality and performance,
-        but not mandatory, that the class extend
-        <code>org.apache.naming.resources.BaseDirContext</code>, as well as
-        use the special object types provided in the
-        <code>org.apache.naming.resources</code> for returned objects.
-        If not specified, the standard value (defined below) will be used.</p>
+        <p>Java class name of the implementation to use. This class must
+        implement the <code>org.apache.catalina.WebResourceRoot</code>
+        interface. If not specified, the standard value (defined below) will be
+        used.</p>
       </attribute>
 
     </attributes>
@@ -89,39 +83,85 @@
   <subsection name="Standard Implementation">
 
     <p>The standard implementation of <strong>Resources</strong> is
-    <strong>org.apache.naming.resources.FileDirContext</strong>, and
+    <strong>org.apache.catalina.webresources.StandardRoot</strong>, and
     is configured by its parent Context element.</p>
 
   </subsection>
 
-  <subsection name="VirtualDirContext implementation">
-    <p>This implementation of <strong>Resources</strong> is
-    <strong>org.apache.naming.resources.VirtualDirContext</strong> and is aimed
to be used
-    during development to deploy a webapp without copying files to a webapp compliant
-    directory structure.
-    It extends <code>FileDirContext</code> and supports the following
-    additional attributes</p>
-
-    <attributes>
-      <attribute name="extraResourcePaths" required="false">
-        <p>Allows to map a path of the filesystem to a path in the webapp. Multiple
-        filesystem paths can be mapped to the same path in the webapp. Filesystem
-        path and virtual path must be separated by an equal signe (=). Pairs of paths
-        must be separated by a column.</p>
-        Example: <code>/=/Users/jdoe/mywebapp/src/main/webapp,/=/Users/jdoe/mywebapp/src/main/webapp2,/pictures=/Users/jdoe/sharedpictures</code>
-        <p>The path to the docBase (as declared in the Context) must not be added here.</p>
-        <p>This attribute enhances the feature provided by the <code>aliases</code>
-        attribute of the <strong>StandardContext</strong>.</p>
-      </attribute>
-    </attributes>
-  </subsection>
-
 </section>
 
 
 <section name="Nested Components">
 
-  <p>No components may be nested inside a <strong>Resources</strong> element.</p>
+  <p>A web application&apos;s main resources are defined by the
+  <strong>docBase</strong> defined for the <a href="context.html">Context</a>.
+  Additional resources may be made available to the web application by defining
+  one or more nested components.</p>
+
+  <h3>PreResources</h3>
+
+  <p>PreResources are searched before the main resources. They will be searched
+  in the order they are defined. To configure PreResources, nest a
+  &lt;PreResources&gt; element inside the &lt;Resources&gt; element with
the
+  following attributes:</p>
+
+  <attributes>
+
+    <attribute name="base" required="true">
+      <p>Identifies where the resources to be used are located. This attribute
+      is required by the <code>org.apache.catalina.WebResourceSet</code>
+      implementations provided by Tomcat and should specify the absolute path to
+      the file, directory or JAR where the resources are located. Custom
+      implementations may not require it.</p>
+    </attribute>
+
+    <attribute name="className" required="true">
+      <p>Java class name of the implementation to use. This class must
+      implement the <code>org.apache.catalina.WebResourceSet</code> interface.
+      Tomcat provides three standard implementations:
+      <code>org.apache.catalina.webresources.DirResourceSet</code>,
+      <code>org.apache.catalina.webresources.FileResourceSet</code> and
+      <code>org.apache.catalina.webresources.JarResourceSet</code>. Custom
+      implementations may also be used.
+      </p>
+    </attribute>
+
+    <attribute name="internalPath" required="false">
+      <p>Identifies the path within the <strong>base</strong> where the
+      resources are to be found. This is typically only used with JAR files when
+      the resources are not located at the root of the JAR as is the case with
+      resource JARs. This attribute is required by the
+      <code>org.apache.catalina.WebResourceSet</code> implementations provided
+      by Tomcat. Custom implementations may not require it. If not specified,
+      the default value of the empty string will be used.</p>
+    </attribute>
+
+    <attribute name="webAppMount" required="false">
+      <p>Identifies the path within the web application that these resources
+      will be made available. This attribute is required by the
+      <code>org.apache.catalina.WebResourceSet</code> implementations provided
+      by Tomcat. Custom implementations may not require it. If not specified,
+      the default value of the empty string will be used.</p>
+    </attribute>
+
+  </attributes>
+
+  <h3>JAR resources</h3>
+
+  <p>JarResources are searched after the main resources but before the
+  PostResources. They will be searched in the order they are defined. To
+  configure JarResources, nest a &lt;JarResources&gt; element inside the
+  &lt;Resources&gt; element. The configuration attributes are the same as for
+  <strong>PreResources</strong>.
+  </p>
+
+  <h3>Post-resources</h3>
+
+  <p>PostResources are searched after the resource JARs. They will be searched
+  in the order they are defined. To configure PostResources, nest a
+  &lt;PostResources&gt; element inside the &lt;Resources&gt; element. The
+  configuration attributes are the same as for <strong>PreResources</strong>.
+  </p>
 
 </section>
 

Modified: tomcat/trunk/webapps/docs/security-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/security-howto.xml?rev=1401503&r1=1401502&r2=1401503&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/security-howto.xml (original)
+++ tomcat/trunk/webapps/docs/security-howto.xml Tue Oct 23 22:38:16 2012
@@ -255,8 +255,7 @@
 
       <p>The <strong>allowLinking</strong> attribute controls if a context
is
       allowed to use linked files. If enabled and the context is undeployed, the
-      links will be followed when deleting the context resources. To avoid this
-      behaviour, use the <strong>aliases</strong> attribute. Changing this
+      links will be followed when deleting the context resources. Changing this
       setting from the default of <code>false</code> on case insensitive
       operating systems (this includes Windows) will disable a number of
       security measures and allow, among other things, direct access to the



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message