users@glassfish.java.net

Re: Precompiling JSPs

From: <glassfish_at_javadesktop.org>
Date: Sun, 14 Mar 2010 20:52:26 PDT

Thanks for this posting....I was able to get it working, however I modified my build.xml file this way, to ensure that the copy is executed after the JSPs are compiled:

[i] <target name="addCompiledJSPs">
        <echo message="Placing compiled JSPs into ${build.classes.dir}"/>
        <copy todir="${build.classes.dir}">
          <fileset dir="${build.generated.dir}/classes"/>
        </copy>
    </target>[/i]

    <target depends="init,compile,compile-jsps,-pre-dist,addCompiledJSPs,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist" />


Here is an example of one of the entries in the web.xml (note that you have to add each of these tags for each JSP):

[i]<servlet>
<servlet-name>index.jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>index.jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>[/i]
[Message sent by forum member 'behrens' (dotjava_at_netzero.net)]

http://forums.java.net/jive/thread.jspa?messageID=391852