Odd, I do not have this problem.

Make sure you are building to a scratchpad. This means your web.xml is copied to a new location before you precompile. Then JSPC can edit it in place and you no not lose any of your changes.

To get around the relative pathing issue - prefix your build with ${basedir}. For example:
<jasper2 compile="true"
validateXml="false"
uriroot="${basedir}/${build.dir}"
poolingEnabled="false"
webXmlFragment="${basedir}/${build.dir}/WEB-INF/generated_web.xml"
addWebXmlMappings="true"
outputDir="${basedir}/${jspc.base}"/>



-Tim

Andreas Schildbach wrote:

Hello everyone,

I've got a bit of a problem precompiling JSPs for Tomcat 5.0. To be exact, the problem is the web.xml fragment that is generated by JspC containing the servlet and servlet-mapping elements.

That fragment has to be included in the web.xml file somehow. Of course, I don't want to do this manually after each precompile. What's the best way to include the fragment automatically?

If I use the XML entity inclusion mechanism, I run into some problems. First, if I enter statements into my original web.xml, the XML parser also wants to include when JspC tries to open the file (at this point obviously the generated file is not yet present). The second problem is that the path of the included file seems to be relative to the current directory - not relative to the including XML file.

What are the alternatives?

Personally, I'd prefer to use a transparent process. First, the web-app is assembled using no precompilation. It should be fully functional at this point (for development and testing), which means that there can't be any tokens or inclusion instructions in web.xml. In a second step, the web-application should be transformed to an application with all JSPs precompiled, with all descriptor modifications that are needed. It would be perfect if in this state the application would still be fully independant of Tomcat.

Any help, any thoughts? Thanks a lot!

Regards,

Andreas


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to