Compile nested jsp pages

C

carlo

Hello All.

Have anyone tried compiling a large JSP project in ANT or similar to
produce a war file? I have the problem that since jsp A includes jsp B,
B has been programmed so that it references elements from the A scope.
Hence when I just compile each jsp file to a java file and compiles the
java files, symbols cannot be found... how can I tell ant only to
compile the "top level pages".. as the example above, just compile A
not B.??

I'd rather not manually delete all the bad java files before compiling
with javac...



my ant script...



<target name="compile" depends="jspc">
<javac destdir="${webapp.path}/WEB-INF/classes"
optimize="on"
debug="on"
verbose="${flag.java.verbose}"
deprecation="true"
failonerror="true"
encoding="utf-8"

fork="true"
memoryInitialSize="100m"
memoryMaximumSize="512m"

srcdir="${webapp.path}/WEB-INF/src"
source="1.5" >
<classpath>
<pathelement location="${webapp.path}/WEB-INF/classes"/>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<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="${webapp.path}/WEB-INF/classes">
<include name="**/*.jar"/>
</fileset>

</classpath>
<include name="**" />
<exclude name="tags/**" />

<compilerarg value="-Xlint:unchecked" />
<compilerarg line="-Xmaxerrs 10000" />
<compilerarg line="-Xmaxwarns 10000" />

</javac>

</target>


<target name="jspc">
<echo message="compiling jsp -> java - takes app. 1 minute" />
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/lib/tools.jar"/>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>

<jasper2 verbose="${flag.jsp.verbose}"
validateXml="false"
uriroot="${webapp.path}"
webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
outputDir="${webapp.path}/WEB-INF/src" />
</target>



many thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top