Hi Carl
Thanks for your sample. I tried it, it throws me exception with
[jasperc] java.lang.ArrayIndexOutOfBoundsException: 98
[jasperc] at org.apache.jasper.JspC.locateUriRoot(JspC.java:616)
[jasperc] at org.apache.jasper.JspC.execute(JspC.java:747)
[jasperc] at org.apache.jasper.JspC.main(JspC.java:810)
[jasperc] Exception in thread main
Do yuo know what is wrong?
Billy Ng
- Original Message -
From: Carl Trusiak [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, December 14, 2002 5:49 AM
Subject: Re: Precomplie Jsps
If you are using Ant, there is an Optional task which
ships with it. I use it on my project and it works
great. I have Tomcat 4.1.12 and Ant 1.5.1
The Relavent portions are:
taskdef name=jspc
classname=org.apache.tools.ant.taskdefs.optional.jsp.JspC/
!-- create reusable classpath --
path id=1
pathelement
location=${project.home}/webapp/WEB-INF/classes /
pathelement
location=${project.home}/pittjugtest /
fileset dir=${project.home}/lib
include name=**/*.jar /
/fileset
fileset dir=${tomcat.home}/common/lib
include name=*.jar /
/fileset
/path
!-- Jspc --
target name=buildJSP depends=cleanJSPBuildDir,
createJSPBuildDir
jspc srcdir=${project.home}
destdir=${project.home}/gensrc verbose=9
classpath refid=1/
include name=**/*.jsp /
/jspc
/target
!-- cleanJSPBuildDirectory --
target name=cleanJSPBuildDir
delete includeEmptyDirs=true quiet=false
failonerror=false
fileset dir=${project.home}/gensrc /
/delete
/target
!-- createJSPBuildDir --
target name=createJSPBuildDir
mkdir dir=${project.home}/gensrc/
/target
You can also exclude files that are fragments that
will not complile properly on thier own.
I haven't tried to use the compiled classes with
Tomcat but, I think if you set your TragetDirectory to
${TOMCAT_HOME}/${WORK_DIRECTORY}/${WEBAPP_NAME} it
should use these.
Work directory is how your tomcat names the work
directory. On my machine, I'm running as standalone
and localhost so it is standalone/localhost Check to
see what it is on yours.
See the JspC task under optional tasks
http://jakarta.apache.org/ant/manual/index.html
Carl
--- Billy Ng [EMAIL PROTECTED] wrote:
Hi folks,
Would any body please tell me how to pre-compile jsp
files. Any websites with step by step instruction
will help too.
Thanks in advance!
Billy Ng
__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]