1 Reply Latest reply on Feb 26, 2004 7:42 AM by Wonne Keysers

    Precomiling JSPs in JBOSS3.2.x

    Thomas Le Newbie

      Does anyone know how to precompile the jsp in a webapp in JBOSS? I have over 300 jsps that I would like precompile. JBOSS or Tomcat takes for ever compile the jsps on the first request. Any answers is apprieciated.

        • 1. Re: Precomiling JSPs in JBOSS3.2.x
          Wonne Keysers Newbie

          Here's a little snippet of our ant script:

           <target name="jspc.init">
           <mkdir dir="\${build.web.jsp}" />
           </target>
          
           <target name="jspc" depends="jspc.init">
           <jasper2 validateXml="false"
           uriroot="\${web}"
           webXmlFragment="\${build.web}/web-gen.xml"
           outputDir="\${build.web.jsp}" />
          
           <javac srcdir="\${build.web.jsp}"
           destdir="\${build.web.class}"
           classpathref="build.classpath"
           debug="true"/>
          
           <loadfile property="jsp.servlets.text" srcFile="\${build.web}/web-gen.xml"/>
          
           <replace file="\${build.web}/web.xml">
           <replacefilter token="&lt;!-- JSPC Insertion Point --&gt;" value="\${jsp.servlets.text}"/>
           </replace>
           </target>
          
           <target name="buildwar.init">
           <mkdir dir="\${build.web.class}" />
           <copy file="\${web}/WEB-INF/web.xml" todir="\${build.web}"/>
           </target>
          
           <target name="buildwar" depends="buildwar.init,jspc">
           <war destfile="\${output}/\${output.warfile}" webxml="\${build.web}/web.xml" manifest="\${manifest}">
           <fileset dir="\${web}" excludes="**/web.xml"/>
           <classes dir="\${build.web.class}" includes="**/*.class"/>
           </war>
           </target>