Jules,
Thanks a million for your help. With your diff, I was able to compile our JSPs to class files. what follows is just to simplify some issues for anyone who follows.
I had to do a bit of borrowing of jar files to get this stuff to work. To run jspC, you need the following jars:
crimson.jar - stolen from JBOSS_HOME/lib.
javax.servlet.jar - stolen from JBOSS_HOME/server/default/lib
org.apache.jasper.jar - stolen from JBOSS_HOME/server/default/lib
xerxesImpl.jar - stolen from the org.apache.xerces_4.0.3 plugin for eclipse, but you can find this else where too.
xmlParserAPIs.jar - stolen from the org.apache.xerces_4.0.3 plugin for eclipse, but you can find this else where too.
I didn't need jive.jar - it's a monster downloading on an ISDN line. Presumably the JBoss web site needs this for something, and maybe you will too.
I don't bother unjar-ing our WAR file, as I have all the unjar'ed files already available. And as I'm not interested in pre-compiling the JSPs before deployment, I don't rejar the WAR file after compilation.
<!--========================================-->
<!-- JSP precompilation starts here -->
<!--========================================-->
<target name="precompile_jsp" unless="war_ok">
<property name="crimson.jar" value="${project.thirdparty}/crimson.jar"/>
<property name="servlet.jar" value="${project.thirdparty}/jetty/javax.servlet.jar"/>
<property name="jsp.precompilation.java" value="/tmp/jsp-java"/>
<property name="jsp.precompilation.webapp" value="${the root of your WAR file contents}"/>
<property name="jsp.precompilation.servlets" value="${jsp.precompilation.webapp}/WEB-INF/jsp-servlets.xml"/>
<echo message="precompiling JSPs..."/>
<delete dir="${jsp.precompilation.java}"/>
<mkdir dir="${jsp.precompilation.java}"/>
<path id="jsp.precompilation.classpath">
<pathelement location="${crimson.jar}"/>
<pathelement location="${log4j.jar.path}"/>
<fileset dir="${project.thirdparty}/jetty">
<include name="*.jar"/>
</fileset>
</path>
<path id="jsp.compilation.classpath">
<fileset dir="${classes.war}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${project.thirdparty}/jetty">
<include name="*.jar"/>
</fileset>
<pathelement location="${log4j.jar.path}"/>
<fileset dir="${classes.war}/WEB-INF/classes/xcom">
<include name="**/*.class"/>
</fileset>
</path>
<!-- compile the *.jsp to *.java -->
<java classname="org.apache.jasper.JspC" fork="true">
<classpath>
<pathelement location="${jsp.precompilation.webapp}/WEB-INF/classes"/>
<fileset dir="${jsp.precompilation.webapp}/WEB-INF/lib"><include name="*.jar"/></fileset>
<path refid="jsp.precompilation.classpath"/>
</classpath>
<arg value="-d"/>
<arg value="${jsp.precompilation.java}"/>
<arg value="-p"/>
<arg value="precompiled"/>
<arg value="-webinc"/>
<arg value="${jsp.precompilation.servlets}"/>
<arg value="-webapp"/>
<arg value="${jsp.precompilation.webapp}"/>
</java>
<echo message="generated {jsp.precompilation.java}/precompiled/*.java from *.jsp" />
<!-- compile the *.java to *.class Servlets -->
<javac
srcdir="${jsp.precompilation.java}"
destdir="${jsp.precompilation.webapp}/WEB-INF/classes"
debug="${javac.debug}"
deprecation="${javac.deprecation}">
<classpath refid="jsp.compilation.classpath"/>
</javac>
<echo message="precompiling JSPs...done"/>
</target>
Ciao,
Jonathan O'Connor
Ph: +353 1 872 3305
Mob: +353 86 824 9736
Fax: +353 1 873 3612
| Jules Gosnell <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 03.07.2002 23:59
|
To: [EMAIL PROTECTED] cc: Subject: Re: [JBoss-user] Where does Jetty store its compiled JSPs? |
I wish I could send you a nice ant task to do it automagically - I
haven't got one.
I can send you this though.
I have just fixed up the JBoss website to precompile JSPs.
This is a diff showing the code I added to the build.xml
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/website/content/build.xml.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h
and this is a diff showing what I added to the web.xml
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/website/content/src/resources/content-war/WEB-INF/web.xml.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h
The comment line in the web.xml MUST be after the last <servlet/> and
before the first <servlet-mapping/> directive.
JspC will generate some xml <servlet/> and <servlet-mapping/> elements
which I substitute in at this comment.
The rest you will have to figure out for yourself - it is well commented.
You will probably not need some of the workarounds I have had to
retrofit.....
This took me quite a while to work out, but now that it is there for
everyone to see, it should be relatively easy to figure out what is
going on.
Good luck, come back to me if you have no joy.
Jules
Jonathan.O'[EMAIL PROTECTED] wrote:
>
> Jules,
> Your answer is truly socratic! What we really want to do is to
> pre-compile the JSPs before deployment and check for syntax errors. Our
> build-deploy-test cycle is slow enough as it is without adding syntax
> errors in our JSP to the pot.
>
> We are moving over from netbeans to Eclipse, so any IDE support/plugin
> would be great. Or even better, an ant task would be just perfect!
> Ciao,
> Jonathan O'Connor
> Ph: +353 1 872 3305
> Mob: +353 86 824 9736
> Fax: +353 1 873 3612
>
>
> *Jules Gosnell <[EMAIL PROTECTED]>*
> Sent by: [EMAIL PROTECTED]
>
> 02.07.2002 18:17
> Please respond to jboss-user
>
>
> To: [EMAIL PROTECTED]
> cc: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Where does Jetty store its
> compiled JSPs?
>
>
>
>
> This would go better on [EMAIL PROTECTED]
>
> I'd have to counter with a question...
>
> Why do you want know ?
>
>
> Wherever it stores them is proprietary implementation and not defined by
> the spec. Therefore the implementation probably reserves the right to
> change this.
>
> If you want to write JSPs into a deployed dir, deploy your war unpacked
> into JBoss' deploy/ dir (e.g. my.war/...).
>
> If you really want to see what Jasper (Jetty's JSP engine) is doing,
> look in /tmp for directories that begin "Jetty".
>
> If you want to know how to precompile your JSPs, so you can check all
> this in your development iteration, let me know and I will tell you how.
>
> Does that cover it ?
>
> Jules
>
>
>
> Jonathan.O'[EMAIL PROTECTED] wrote:
> >
> > Folks,
> > I have a feeling that the answer to this is "It doesn't", but if anyone
> > knows better please let me know.
> > Thanks,
> > Jonathan O'Connor
> > Ph: +353 1 872 3305
> > Mob: +353 86 824 9736
> > Fax: +353 1 873 3612
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
