<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 首頁 新隨筆 聯(lián)系 聚合 管理
      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 閱讀(602) 評論(0)  編輯  收藏 所屬分類: java
    主站蜘蛛池模板: 99re免费在线视频| 亚洲天天在线日亚洲洲精| 亚洲午夜成激人情在线影院| 精品多毛少妇人妻AV免费久久| 97无码免费人妻超级碰碰碰碰| 91在线精品亚洲一区二区| 亚洲成人免费网站| 亚洲理论片在线中文字幕| 在线视频免费观看高清| 亚洲欧美自偷自拍另类视| 日本免费高清一本视频| 美女视频黄a视频全免费网站一区| 亚洲成aⅴ人片久青草影院| 一区二区三区免费视频播放器| 亚洲色偷拍另类无码专区| 成全视频免费观看在线看| 亚洲欧洲自拍拍偷综合| 免费精品国偷自产在线在线 | 亚洲视频在线免费观看| 亚洲综合激情六月婷婷在线观看| 日本亚洲免费无线码| 亚洲www77777| 亚洲区日韩区无码区| 99久久人妻精品免费二区| 亚洲最大无码中文字幕| 久久国产成人亚洲精品影院| 亚欧免费一级毛片| 亚洲国产精品免费观看| 中文字幕亚洲第一| 成人免费的性色视频| 日韩免费高清一级毛片| 五月天网站亚洲小说| 在线看片无码永久免费aⅴ| 中国毛片免费观看| 亚洲中文无码卡通动漫野外| 亚洲人成色777777在线观看| 免费看污成人午夜网站| 久久久精品视频免费观看| 亚洲理论在线观看| 国产亚洲美日韩AV中文字幕无码成人 | 麻豆最新国产剧情AV原创免费|