java - How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant -
we have usual web.xml our web application includes jsp , jsp tag files. want switch using pre-compiled jsp's. have pre-compilation happening in build ok, , generates web.xml fragment , want merge fragment main web.xml.
is there include type directive web.xml let me include fragment.
ideally leave things dev- useful change jsp's on fly , see changes uat/prod, jsp's pre-compiled , work faster.
i use tomcat jasper ant tasks in project, precompile jsps servlets , add new servlet mappings original web.xml. in dev builds, skip step , deploy jsps without pre-compile , modification of web.xml.
<?xml version="1.0"?> <project name="jspc" basedir="." default="all"> <import file="${build.appserver.home}/bin/catalina-tasks.xml"/> <target name="all" depends="jspc,compile"></target> <target name="jspc"> <jasper validatexml="false" uriroot="${build.war.dir}" webxmlfragment="${build.war.dir}/web-inf/generated_web.xml" addwebxmlmappings="true" outputdir="${build.src.dir}" /> </target> <target name="compile"> <javac destdir="${build.dir}/classes" srcdir="${build.src.dir}" optimize="on" debug="off" failonerror="true" source="1.5" target="1.5" excludes="**/*.smap"> <classpath> <fileset dir="${build.war.dir}/web-inf/classes"> <include name="*.class" /> </fileset> <fileset dir="${build.war.lib.dir}"> <include name="*.jar" /> </fileset> <fileset dir="${build.appserver.home}/lib"> <include name="*.jar" /> </fileset> <fileset dir="${build.appserver.home}/bin"> <include name="*.jar"/> </fileset> </classpath> <include name="**" /> <exclude name="tags/**"/> </javac> </target> <target name="clean"> <delete> <fileset dir="${build.src.dir}"/> <fileset dir="${build.dir}/classes/org/apache/jsp"/> </delete> </target> </project> if have jsp compilation working , want merge web.xml files, simple xslt written add selected elements(such servlet mappings) newly generated web,xml original.
Comments
Post a Comment