You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Susan Richards <ri...@matc.edu> on 2008/09/08 21:37:48 UTC

Ant Build.xml file

How would I add to the build.xml file so that when ant builds it, it creates this code in my web.xml file?
 
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
 
Not sure if this is an element or something else and what to add it under.

Re: Ant Build.xml file

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Susan,

Susan Richards wrote:
> How would I add to the build.xml file so that when ant builds it, it
> creates this code in my web.xml file?
> 
> <error-page>
>   <error-code>404</error-code>
>   <location>/404.html</location>
> </error-page>

Why not simply add it to web.xml permanently?

If you really do need to do it on the fly, you can do it with an XSL
template:

    <!-- Make a backup copy of web.xml -->
    <copy file="web.xml" toFile="web.xml.copy" />

    <xslt in="web.xml.copy"
          out="web.xml"
          style="web.xml.changes.xsl"
        />

The contents of the web.xml.changes.xsl file are trivial and left as an
exercise to the reader ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjJRjAACgkQ9CaO5/Lv0PAKjACePT30esw5ozYZtdD0HcuFlfMm
nXEAn2U4VFPgx3Kobs/qk9ldenFIb81v
=nF0S
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org