Hi I'm trying to precompile my JSPs in ANT and I'm using Tomcat5. Below is my taskdef:
<target name="jsp" depends="build">
<!--
The Ant JSPC task doesn't work with Tomcat 5.0
so in the meantime we need to define our own task.
-->
<taskdef name="jspc50" classname="org.apache.jasper.JspC">
<classpath id="jspc50.classpath">
<fileset dir="${tomcat.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jspc50 outputDir="${classes}"
uriroot="${src}"
package="jsp"
validateXml="false">
<include name="**/*.jsp" />
<exclude name="**/includes/**/*.jsp" />
</jspc50>
<javac srcdir="${classes}"
destdir="${classes}"
debug="true"
optimize="false"
includes="**/*.java"
source="1.4">
</javac>
</target>
Now, this actually works but if I use an absolute include directive in my JSPs like:
<%@ include file="/includes/header.jsp" %>
Then I get the "/include/header.jsp" not found. However, if I change to
<jsp:include page="/includes/header.jsp" />
It works fine. Now, I want to use an absolute path and I also want to use the include directive. Has anybody seen this problem and know a solution?
Thanks,
Mike