JSP pre-compiled ant script in Tomcat

Source: Internet
Author: User

<Project name = "webapp precompilation" default = "all" basedir = ".">
<Property name = "tomcat. Home" value = "D:/apache-tomcat-4.1.34-LE-jdk14"/>
<Property name = "webapp. Path" value = "D:/eclipse3.1/workspace/mpa2.3/webmodule"/>
<Property name = "Java. Home" value = "D:/Java/jdk1.5.0"/>
<Target name = "jspc">
<Taskdef classname = "org. Apache. Jasper. jspc" name = "jasper2">
<Classpath id = "jspc. classpath">
<Pathelement location = "$ {java. Home}/../lib/tools. Jar"/>
<Fileset dir = "$ {tomcat. Home}/Server/lib">
<Include name = "*. Jar"/>
</Fileset>
<Fileset dir = "$ {tomcat. Home}/common/lib">
<Include name = "*. Jar"/>
</Fileset>
</Classpath>
</Taskdef>

<Jasper2 validatexml = "false" uriroot = "$ {webapp. path} "webxmlfragment =" $ {webapp. path}/WEB-INF/generated_web.xml "outputdir =" $ {webapp. path}/WEB-INF/src "/>

</Target>

<Target name = "compile">

<Mkdir dir = "$ {webapp. Path}/WEB-INF/classes"/>
<Mkdir dir = "$ {webapp. Path}/WEB-INF/lib"/>

<Javac destdir = "$ {webapp. path}/WEB-INF/classes "optimize =" off "DEBUG =" on "failonerror =" false "srcdir =" $ {webapp. path}/WEB-INF/src "excludes = "**/*. SMAP ">
<Classpath>
<Pathelement location = "$ {webapp. Path}/WEB-INF/classes"/>
<Fileset dir = "$ {webapp. Path}/WEB-INF/lib">
<Include name = "*. Jar"/>
</Fileset>
<Pathelement location = "$ {tomcat. Home}/common/classes"/>
<Fileset dir = "$ {tomcat. Home}/common/lib">
<Include name = "*. Jar"/>
</Fileset>
<Pathelement location = "$ {tomcat. Home}/shared/classes"/>
<Fileset dir = "$ {tomcat. Home}/shared/lib">
<Include name = "*. Jar"/>
</Fileset>
</Classpath>
<Include name = "**"/>
<Exclude name = "taglib/**"/>
</Javac>

</Target>

<Target name = "all" depends = "jspc, compile"> </Target>

</Project>

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.