Discussion:
[Middlegen-user] Ant and JSP compile
Jordan Thomas
2003-01-31 09:15:01 UTC
Permalink
Hi,

How do I compile all of my JSP's with ant? I am using tomcat and JBoss. Any
pointers, example code would be most appreciated.

thanks

Jordan
M.-Leander Reimer
2003-01-31 09:28:16 UTC
Permalink
Hi Jordan,

there is an Ant task called "jspc" to compile JSPs into Java files, which
you can then compile using the "javac" task. Here is a sample target like I
am using it.

<target name="compile-jsp" description="Compile all JSP files">
<mkdir dir="${build.jsp.dir}"/>
<path id="jasper.class.path">
<pathelement
path="${jboss.home}/catalina/lib/jasper-compiler.jar"/>
<pathelement path="${jboss.home}/catalina/lib/jasper-runtime.jar"/>
<pathelement path="${lib.dir}/servlet.jar"/>
<!-- include other required libraries here, e.g. struts.jar -->
</path>
<!-- Compile JSP files to Java files -->
<jspc srcdir="${web.src.dir}"
destdir="${build.jsp.dir}"
classpathref="jasper.class.path"
verbose="1">
<include name="**/*.jsp" />
</jspc>
<!-- Compile generated Java files -->
<javac srcdir="${build.jsp.dir}"
destdir="${build.jsp.dir}"
classpathref="jasper.class.path">
<include name="**/*.java"/>
</javac>
</target>

Hope that helps.

Leander

-----Ursprüngliche Nachricht-----
Von: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]Im Auftrag von Jordan
Thomas
Gesendet: Freitag, 31. Januar 2003 12:13
An: middlegen-***@lists.sourceforge.net
Betreff: [Middlegen-user] Ant and JSP compile


Hi,

How do I compile all of my JSP's with ant? I am using tomcat and JBoss. Any
pointers, example code would be most appreciated.

thanks

Jordan



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Rod Macpherson
2003-01-31 15:00:05 UTC
Permalink
Not really a middlegen question but here's a hint. Doesn't really dump
the results where tomcat wants them or even create a package structure,
but it does translate all the JSPs and compile them.

<path id="jspc-classpath">
<pathelement path="/j2ee/lib/j2ee.jar"/>
<pathelement
path="/jboss/server/default/lib/whatever.jar"/>
<pathelement
path="/jboss/server/default/deploy/jbossweb.sar/org.apache.jasper.jar"/>
</path>

<target name="jspc" depends="prepare" description="Precompile
JSPs.">

<java fork="true" classname="org.apache.jasper.JspC"
classpathref="jspc-classpath">
<arg line="-dd /tmp -webapp
/jboss/server/default/deploy/your-exploded-war"/>
</java>

<javac
srcdir="/tmp/src"
destdir="/tmp/src/results"
classpathref="jspc-classpath"
/>
</target>

-----Original Message-----
From: Jordan Thomas [mailto:***@ipa.fraunhofer.de]
Sent: Friday, January 31, 2003 3:13 AM
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Ant and JSP compile


Hi,

How do I compile all of my JSP's with ant? I am using tomcat and JBoss.
Any pointers, example code would be most appreciated.

thanks

Jordan



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Loading...