<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    jinfeng_wang

    G-G-S,D-D-U!

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      400 Posts :: 0 Stories :: 296 Comments :: 0 Trackbacks
    Web Application Compilation

    Using Ant is the preferred way to compile web applications using JSPC. Use the script given below to precompile a webapp:

    <project name="Webapp Precompilation" default="all" basedir="."> 
    
      <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}/bin"> 
              <include name="*.jar"/> 
            </fileset> 
            <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>
            <fileset dir="${tomcat.home}/bin"> 
              <include name="*.jar"/> 
            </fileset> 
          </classpath>
          <include name="**" />
          <exclude name="tags/**" />
        </javac>
    
      </target>
    
      <target name="all" depends="jspc,compile">
      </target>
    
    </project>
    

    The following command line can be used to run the script (replacing the tokens with the Tomcat base path and the path to the webapp which should be precompiled):

    $ANT_HOME/ant -Dtomcat.home=<$TOMCAT_HOME> -Dwebapp.path=<$WEBAPP_PATH>
    

    Then, the declarations and mappings for the servlets which were generated during the precompilation must be added to the web application deployment descriptor. Insert the ${webapp.path}/WEB-INF/generated_web.xml at the right place inside the ${webapp.path}/WEB-INF/web.xml file. Restart the web application (using the manager) and test it to verify it is running fine with precompiled servlets. An appropriate token placed in the web application deployment descriptor may also be used to automatically insert the generated servlet declarations and mappings using Ant filtering capabilities. This is actually how all the webapps distributed with Tomcat are automatically compiled as part of the build process.

    posted on 2005-12-15 22:42 jinfeng_wang 閱讀(597) 評論(0)  編輯  收藏 所屬分類: java
    主站蜘蛛池模板: 久久亚洲国产欧洲精品一| 免费国产怡红院在线观看| 亚洲av无码一区二区乱子伦as| 无人视频免费观看免费视频| 四虎永久免费地址在线观看| 久久无码av亚洲精品色午夜| 免费A级毛片无码A∨男男| 免费看一级一级人妻片| 亚洲人成人网站在线观看| 岛国岛国免费V片在线观看| 亚洲日韩国产精品第一页一区| 99久久免费国产精品热| 亚洲午夜久久影院| 国产精品怡红院永久免费| 亚洲色大情网站www| 国产免费拔擦拔擦8x| 黄色a级片免费看| 久久亚洲中文字幕精品一区四 | 亚洲AV日韩AV永久无码色欲| 国产精品成人四虎免费视频| 日产久久强奸免费的看| 亚洲αv在线精品糸列| 青青在线久青草免费观看| 精品亚洲av无码一区二区柚蜜| 亚洲综合精品网站| 一级毛片免费观看不卡的| 亚洲高清有码中文字| 亚洲伊人成无码综合网 | 成年大片免费高清在线看黄| 亚洲欧洲精品无码AV| 日本免费一区二区在线观看| 亚洲av永久无码一区二区三区| AV在线播放日韩亚洲欧| 日日麻批免费40分钟日本的| 国产精品亚洲综合天堂夜夜| 亚洲国产精彩中文乱码AV| 免费涩涩在线视频网| 免费人成在线观看视频高潮| 亚洲中文字幕无码av| 好看的电影网站亚洲一区| 黑人粗长大战亚洲女2021国产精品成人免费视频 |