<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
    主站蜘蛛池模板: 精品无码一级毛片免费视频观看 | 国产亚洲精品bv在线观看| 日本免费人成网ww555在线| 亚洲成AⅤ人影院在线观看| 亚洲精品天堂无码中文字幕| 波多野结衣中文字幕免费视频 | 亚洲国产成人久久综合一| 老司机69精品成免费视频| 亚洲最大的成网4438| 久久久久久成人毛片免费看| 久久亚洲免费视频| 18禁美女裸体免费网站| 亚洲免费中文字幕| 成人毛片免费在线观看| 美女露隐私全部免费直播| 亚洲日韩国产精品乱| 中国一级特黄高清免费的大片中国一级黄色片| 亚洲午夜无码AV毛片久久| 久久福利青草精品资源站免费| 亚洲黄网在线观看| 好男人视频社区精品免费| 看免费毛片天天看| 亚洲乱码国产乱码精品精| 69影院毛片免费观看视频在线 | 日韩电影免费在线观看中文字幕| 亚洲欧洲第一a在线观看| 在线精品一卡乱码免费| 国产精品亚洲精品久久精品| 久久精品国产亚洲AV不卡| 国产精品免费AV片在线观看| 国产亚洲精品VA片在线播放| 亚洲精品成人网久久久久久| 99精品视频在线视频免费观看| 亚洲视频在线观看2018| 亚洲精品网站在线观看不卡无广告| 国产一区二区三区免费| 亚洲一卡2卡3卡4卡乱码 在线| 亚洲精品色婷婷在线影院| 亚洲一区二区三区免费观看| 曰批免费视频播放在线看片二 | 亚洲成A人片在线观看无码3D|