Where should the compiled JSP files be generated? In this example it seems that the generated JSP files are compiled to the normal WEB-INF/classes dir. But i know that tomcat genarates/compiles JSP files in "work" dir. Will it not do this if it finds compiled JSPs in my WEB-INF/classes folder?
Thanks and reagrds, Affan ----- Original Message ----- From: "Matt Raible" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, December 22, 2002 12:16 PM Subject: Ant's jspc task - doesn't work on Tomcat 4.1.18 > > I'm trying to use Ant's JSPC task to pre-compile my JSPs. I've used Erik > Hatcher's example from Java Development with Ant. It works great when > using a 4.0.x version of Tomcat, and the following jasper.classpath: > > <path id="jasper.classpath"> > <fileset dir="${tomcat.home}/lib"> > <include name="jasper-*.jar"/> > </fileset> > <fileset dir="${tomcat.home}/common/lib"> > <include name="servlet.jar"/> > </fileset> > </path> > > However, it doesn't work on Tomcat 4.1.17. I had to change the > jasper.classpath to find the appropriate jars (they're in different > directories now), plus I had to include ant.jar or I got > java.lang.NoClassDefFoundError: org/apache/tools/ant/AntClassLoader. > Where everything works on the older Tomcat version, now it fails - what > gives? > > compile-jsp: > [jspc] Compiling 8 source filesD:\source\appfuse\build\jspc\java > [jasperc] 2002-12-21 11:15:51 - uriRoot implicitly set to > "D:\Tools\tomcat-4.1.17\webapps\appfuse" > [jasperc] error:/common/footer.jsp(0,0) null > [jasperc] 2002-12-21 11:15:53 - ERROR-the file '\common\footer.jsp' > generated the following general exception: > org.apache.jasper.JasperException: > /common/footer.jsp(0,0) null > > Also, what's the best way to detect if the user has Tomcat 4.0 vs. 4.1? > > Thanks, > > Matt > > > <!-- =================================================================== > --> > <!-- Compile JSPs using jspc > --> > <!-- =================================================================== > --> > <property name="build.jspc.java.dir" > location="${build.dir}/jspc/java" /> > > <property name="build.jspc.classes.dir" > location="${build.dir}/jspc/classes" /> > > <property name="war.expanded.dir" > location="${tomcat.home}/webapps/${webapp.name}" /> > > <path id="jasper.classpath"> > <!-- Tomcat 4.0.x --> > > <fileset dir="${tomcat.home}/lib"> > <include name="jasper-*.jar"/> > </fileset> > <fileset dir="${tomcat.home}/common/lib"> > <include name="servlet.jar"/> > </fileset> > > <!-- Tomcat 4.1.x --> > <!----> > <fileset dir="${tomcat.home}/common/lib"> > <include name="ant.jar"/> > <include name="servlet.jar"/> > <include name="jasper-*.jar"/> > </fileset> > --> > </path> > > <target name="compile-jsp" depends="deploy-web"> > <mkdir dir="${build.jspc.classes.dir}" /> > <mkdir dir="${build.jspc.java.dir}" /> > > <!-- create the .java files --> > <jspc srcdir="${war.expanded.dir}" verbose="6" > destdir="${build.jspc.java.dir}"> > <include name="*/**.jsp"/> > <classpath refid="jasper.classpath" /> > </jspc> > > <!-- compile the .java files --> > <javac debug="${compile.debug}" > srcdir="${build.jspc.java.dir}" > destdir="${build.jspc.classes.dir}"> > <classpath> > <path > location="${war.expanded.dir}/WEB-INF/classes" /> > <fileset dir="${war.expanded.dir}/WEB-INF/lib"> > <include name="**/*.jar"/> > </fileset> > <path refid="jasper.classpath"/> > </classpath> > </javac> > </target> > > > > -- > 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]>