- Last edited January 3, 2002 |
<property name="tomcat.home" value="C:\APP_SERVERS\TOMCAT"/>Problems (inadequacies):
<path id="jasper.classpath" > <pathelement path="${tomcat.home}/lib/servlet.jar"/> <pathelement path="${tomcat.home}/lib/jasper.jar"/> <pathelement path="${tomcat.home}/lib/jasper.jar"/> <pathelement path="${tomcat.home}/lib/webserver.jar"/> <pathelement path="${tomcat.home}/lib/parser.jar"/> <pathelement path="${tomcat.home}/lib/jaxp.jar"/> </path>
<target name="compile_jsp" depends="prepare"> <mkdir dir="temp" /> <java taskname="jasper" classname="org.apache.jasper.JspC" fork="true" failonerror="true" classpathref="jasper.classpath">
<arg value="-v4" /> <arg value="-dd" /><arg value="temp" /> <arg value="-die" /> <arg value="-webapp" /><arg value="${war.dir}" /> </java> <javac srcdir="temp" destdir="temp" debug="false" deprecation="false" optimize = "false" includes="**/*.java"> <classpath refid="jasper.classpath" /> </javac> </target>
The jasper section of the above target just generates java code (recursively) from all jsps in the ${war.dir} structure. Top level jsp syntax mistakes are caught.
The javac task then compiles the generated javas to catch script code errors. The problem is you get line numbers from the generated code NOT the jsp. Orion's jsp compiler gives code compile errors with line numbers from the jsp. That would be better.
--MilesD
- Last edited January 3, 2002 |