• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Precompiling all the JSPs with Tomcat

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
How can I precompile ALL the JSP files in tomcat 4.0 on start-up? Is there any way using web.xml?

Thanks,
Ashish Agrawal.
 
Ashish Agrawal
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be more specific.....

Does anybody know how to precompile all the jsp files on or before startup of tomcat 4.0?

Like .... maybe using jspc.bat....but it just translates the jsp to .java....but doesn't compile. Each jsp gets compiled only on first http request.

Is there any way to do this using ANT?

Please reply ASAP. Thanks.

- Ashish Agrawal
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried using ant something like this but facing issue not getting where is problem if anybody have idea please tell me.

This is my ant file.

<?xml version="1.0"?>

<project name="pre-compile-jsps" default="all" basedir=".">

<!-- Private properties. -->
<property name="tomcat.home" value="C:\apache-tomcat-8.0.23"/>
<property name="webapp.path" value="${basedir}"/>

<import file="${tomcat.home}/bin/catalina-tasks.xml"/>

<target name="all" depends="jspc,compile"></target>

<target name="jspc">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jasper2
uriroot="./"
outputDir="./"
/>
</target>

<target name="compile">
<javac destdir="./org/apache/jsp"
optimize="off"
debug="on" failonerror="false"
srcdir="./org/apache/jsp">
<classpath>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
</project>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic