You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2014/11/21 13:23:38 UTC
svn commit: r1640905 - /tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
Author: kkolinko
Date: Fri Nov 21 12:23:38 2014
New Revision: 1640905
URL: http://svn.apache.org/r1640905
Log:
Minor corrections:
Remove empty lines before sample text. Add missing '/>'s. Simplify markup by using CDATA.
Modified:
tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml?rev=1640905&r1=1640904&r2=1640905&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml Fri Nov 21 12:23:38 2014
@@ -1359,8 +1359,8 @@ for details.</p>
<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/
+
+<source>mywebapp/
src/
main/
java/
@@ -1371,23 +1371,24 @@ mywebapp/
target/
classes/
</source>
+
<p>To deploy such an application (assuming it also uses the log4j maven artefact),
the context configuration looks like:</p>
-<source wrapped="true">
-<Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" >
- <Resources className="org.apache.naming.resources.VirtualDirContext"
+
+<source wrapped="true"><![CDATA[<Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp">
+ <Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes" />
- <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
+ <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" />
- <JarScanner scanAllDirectories="true" />
-</Context>
-</source>
+ <JarScanner scanAllDirectories="true" />
+</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/
+
+<source>mylib/
src/
main/
java/
@@ -1409,17 +1410,17 @@ mywebapp/
target/
classes/
</source>
+
<p>The configuration is:</p>
-<source wrapped="true">
-<Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" >
- <Resources className="org.apache.naming.resources.VirtualDirContext"
- extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies"
- <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
- 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"
- <JarScanner scanAllDirectories="true" />
-</Context>
-</source>
+<source wrapped="true"><![CDATA[<Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp">
+ <Resources className="org.apache.naming.resources.VirtualDirContext"
+ extraResourcePaths="/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies" />
+ <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
+ 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" />
+ <JarScanner scanAllDirectories="true" />
+</Context>
+]]></source>
<p>Note that resources in mylib/target/classes/META-INF/resources/ are mapped to / as
required by servlet 3 specification.</p>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org