tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Schildbach <andr...@schildbach.de>
Subject Re: Problem with including JspC generated web.xml fragment (solved)
Date Tue, 18 Jan 2005 21:34:37 GMT
> You have still to specify the webXmlFragment-attribute. Without this
> i'm getting a NullpointerException too.

Thanks to the help of both of you, I finally managed to get it to work. 
You'll find my complete Ant target at the bottom of this post.

 From the perspective of a user I'd like to provide the following feedback:

- of course, a documentation would be helpful (-:
- the webXmlFragment option shouldn't be mandatory if 
addWebXmlMappings="true" is specified
- compile="true" does not work at my place, or is at least terribly 
slow. It consumes 100% CPU and seems to take forever...
- it would be great if there was one magic option, let's call it 
transformInPlace="true", which would do all of the following:
    * set addWebXmlMappings to true
    * initialize the outputDir to ${uriroot}/WEB-INF/classes
    * transform all JSPs and delete the original files
    * compile all the generated classes and delete the sources
This way, a complete transformation from non-precompiled to precompiled 
would be possible.
- it would be great if the transformed webapp would have no dependancies 
to Jasper (Tomcat)

And here is my Ant target (the webapp to transform needs to be in dist, 
and you maybe have to adapt the location of your jasper jars):

<target name="jspc">

	<taskdef classname="org.apache.jasper.JspC" name="jasper2">
		<classpath id="jspc.classpath">
			<fileset dir="${env.CATALINA_HOME}/common/lib"><include 
name="*.jar"/></fileset>
			<fileset dir="dist/WEB-INF/lib"><include name="**/*.jar"/></fileset>
		</classpath>
	</taskdef>

	<jasper2
		validateXml="false"
		uriroot="dist"
		addWebXmlMappings="true"
		webXmlFragment="foobar.xml"
		compile="false"
		poolingEnabled="true"
		outputDir="dist/WEB-INF/classes"
	/>
		
	<javac
		srcdir="dist/WEB-INF/classes"
		destdir="dist/WEB-INF/classes"
		includes="org/apache/jsp/**/*.java"
		classpathref="jspc.classpath"
		source="1.5"
		target="1.5"
		encoding="UTF-8"
		debug="false"
		nowarn="true"
	/>

	<delete includeemptydirs="true">
		<fileset dir="dist" includes="**/*.java,**/*.jsp,**/*.jspx"/>
	</delete>

</target>

Unfortunately the includeemptydirs option in the delete statement does 
not work as I would expect: There is still empty directories after 
transformation if you had only JSPs in them.

Regards,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message