tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: JSP pre compilation
Date Sun, 14 Sep 2008 16:07:06 GMT

2 stage process where you need to create the initial java file <BR>
$TOMCAT_HOME\work\Catalina\localhost\HelloClient\<jsp_file_name>_jsp.java<BR>

usualy via some iteration of a jasper (jspc) compile e.g.<BR>
%JAVA_HOME%\bin\java -classpath .;%CLASSPATH% -verbose org.apache.jasper.JspC test.jsp<BR>

and then <jsp_file_name>_jsp.java is compiled to the class<BR>

HTH<BR>
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 


> From: sprasad4@sapient.com
> To: users@tomcat.apache.org
> Date: Sun, 14 Sep 2008 18:22:44 +0530
> Subject: JSP pre compilation
> 
> Hi All,
> 
>           In our web application deployed as a war file in tomcat 5.5.25, after a new
deployment of war file, In order to open any link from home page first time we have click
3 times and also it takes some time. This is due to JSP compilation happening at runtime.
Is there anyway to do JSP compilation at the time of server startup itself ?
> At each time of deployment we are deleting the old directory of application from work
folder as well as webapps folder then copying new warfile to wepapps folder
> then restarting the server. I tried <jasper2> task through ant script as explained
in tomcat documentation but it ends with some error(error related custom tag library),if 
I delete that jsp file which is giving error then it simply says build successful without
creating any class files !
>   Any suggestion please give.
> 
>  Fallowing is the code snippet I tried
> 
>      <target name="jspc">
> 
>     <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
>       <classpath id="jspc.classpath">
>         <pathelement location="${dir.tomcatHome}/../lib/tools.jar"/>
>         <fileset dir="${dir.tomcatHome}/bin">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${dir.tomcatHome}/server/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${dir.tomcatHome}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>       </classpath>
>     </taskdef>
> 
>             <jasper2
>              validateXml="false"
>              uriroot="${web.dir}"
>              webXmlFragment="${web.dir}/WEB-INF/generated_web.xml"
>              outputDir="${web.dir}/WEB-INF/src" />
> 
>                         </target>
> 
>                                      <target name="compile" depends="jspc">
> 
>     <mkdir dir="${web.dir}/WEB-INF/classes"/>
>     <mkdir dir="${web.dir}/WEB-INF/lib"/>
> 
>     <javac destdir="${web.dir}/WEB-INF/classes"
>            optimize="off"
>            debug="on" failonerror="false"
>            srcdir="${web.dir}/WEB-INF/views"
>                    excludes="**/*.smap">
>       <classpath>
>         <pathelement location="${web.dir}/WEB-INF/classes"/>
>         <fileset dir="${web.dir}/WEB-INF/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${dir.tomcatHome}/common/classes"/>
>         <fileset dir="${dir.tomcatHome}/common/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${dir.tomcatHome}/shared/classes"/>
>         <fileset dir="${dir.tomcatHome}/shared/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <fileset dir="${dir.tomcatHome}/bin">
>           <include name="*.jar"/>
>         </fileset>
>       </classpath>
>       <include name="views/*.jsp" />
>       <exclude name="tags/**" />
>                <exclude name="*/failure.jsp" />
>     </javac>
> 
>   </target>
> 
> 
> Thanks and Regards -
> Shreekanta Prasad
> Associate Technology| ¬ Sapient
> Sapient Corporation Pvt. Ltd.0
> #137, Whitefield Road, 6th Floor, 'Vayu' Block
> Salarpuria GR Tech Park, Bangalore - 560066
> Cell : +91.99 00 230 326
> Office : +91.080.4104 7680
> Email :sprasad4@sapient.com
> 

_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message