remm        2003/03/07 02:52:41

  Modified:    webapps/tomcat-docs jasper-howto.xml
  Log:
  - Add documentation on precompilation.
  
  Revision  Changes    Path
  1.7       +91 -0     jakarta-tomcat-4.0/webapps/tomcat-docs/jasper-howto.xml
  
  Index: jasper-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/jasper-howto.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jasper-howto.xml  12 Jan 2003 17:26:46 -0000      1.6
  +++ jasper-howto.xml  7 Mar 2003 10:52:41 -0000       1.7
  @@ -168,6 +168,97 @@
   
   </section>
   
  +<section name="Web application precompilation">
  +
  +<p>Using Ant is the preferred way to precompile web applications. 
  +Use the script given below to precompile a webapp:
  +</p>
  +
  +<p>
  +<source>
  +&lt;project name="Webapp Precompilation" default="all" basedir="."&gt; 
  +
  +  &lt;target name="jspc"&gt; 
  +
  +    &lt;taskdef classname="org.apache.jasper.JspC" name="jasper2" &gt; 
  +      &lt;classpath id="jspc.classpath"&gt; 
  +        &lt;pathelement location="${java.home}/../lib/tools.jar"/&gt; 
  +        &lt;fileset dir="${tomcat.home}/server/lib"&gt; 
  +          &lt;include name="*.jar"/&gt; 
  +        &lt;/fileset&gt; 
  +        &lt;fileset dir="${tomcat.home}/common/lib"&gt; 
  +          &lt;include name="*.jar"/&gt; 
  +        &lt;/fileset&gt; 
  +      &lt;/classpath&gt; 
  +    &lt;/taskdef&gt; 
  +
  +    &lt;jasper2 
  +             compile="false" 
  +             validateXml="false" 
  +             uriroot="${webapp.path}" 
  +             webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" 
  +             outputDir="${webapp.path}/WEB-INF/src" /&gt; 
  +
  +  &lt;/target&gt; 
  +
  +  &lt;target name="compile"&gt;
  +
  +    &lt;mkdir dir="${webapp.path}/WEB-INF/classes"/&gt;
  +    &lt;mkdir dir="${webapp.path}/WEB-INF/lib"/&gt;
  +
  +    &lt;javac destdir="${webapp.path}/WEB-INF/classes"
  +           optimize="off"
  +           debug="on" failonerror="false"
  +           srcdir="${webapp.path}/WEB-INF/src" 
  +        excludes="**/*.smap"&gt;
  +      &lt;classpath&gt;
  +        &lt;pathelement location="${webapp.path}/WEB-INF/classes"/&gt;
  +        &lt;fileset dir="${webapp.path}/WEB-INF/lib"&gt;
  +          &lt;include name="*.jar"/&gt;
  +        &lt;/fileset&gt;
  +        &lt;pathelement location="${tomcat.home}/common/classes"/&gt;
  +        &lt;fileset dir="${tomcat.home}/common/lib"&gt;
  +          &lt;include name="*.jar"/&gt;
  +        &lt;/fileset&gt;
  +        &lt;pathelement location="${tomcat.home}/shared/classes"/&gt;
  +        &lt;fileset dir="${tomcat.home}/shared/lib"&gt;
  +          &lt;include name="*.jar"/&gt;
  +        &lt;/fileset&gt;
  +      &lt;/classpath&gt;
  +      &lt;include name="**" /&gt;
  +      &lt;exclude name="tags/**" /&gt;
  +    &lt;/javac&gt;
  +
  +  &lt;/target&gt;
  +
  +  &lt;target name="all" depends="jspc,compile"&gt;
  +  &lt;/target&gt;
  +
  +&lt;/project&gt;
  +</source>
  +</p>
  +
  +<p>
  +The following command line can be used to run the script
  +(replacing the tokens with the Tomcat base path and the path to the webapp 
  +which should be precompiled):<br/>
  +<source>
  +$ANT_HOME/ant.sh -Dtomcat.home=&lt;$TOMCAT_HOME&gt; 
-Dwebapp.path=&lt;$WEBAPP_PATH&gt;
  +</source>
  +</p>
  +
  +<p>
  +Then, the declarations and mappings for the servlets which were generated 
  +during the precompilation must be added to the web application deployment
  +descriptor. Insert the <code>${webapp.path}/WEB-INF/generated_web.xml</code>
  +at the right place inside the <code>${webapp.path}/WEB-INF/web.xml</code> file.
  +Restart the web application (using the manager) and test it to verify it is 
  +running fine with precompiled servlets.
  +</p>
  +
  +</section>
  +
  +
   <section name="Using Jikes">
   
   <p>If you wish to use
  
  
  

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

Reply via email to