tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antony Paul" <antonypau...@hotmail.com>
Subject Re: Preload JSP when it's startup
Date Fri, 28 Nov 2003 08:34:09 GMT
I use the following Ant build file to precompile all jsps to work dir. I
prepared this based on another post in this list. All the jsps are converted
to java and then to class files.

<project name="myapp" default="all"
basedir="E:\Tomcat4.1\work\Standalone\localhost\myapp">
<!--Simple build file to compile all jsp files to java and javac to the work
directory of tomcat installation -->
<property name="tomcat.home" value="E:\Tomcat4.1"/>
<property name="webapp.path" value="E:\Projects\myapp"/>  <!-- web
application docBase in server.xml  -->

  <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}/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="${basedir}/generated_web.xml"
             outputDir="${basedir}" />

  </target>

 <target name="javac" depends="jspc">

    <javac srcdir="${basedir}" destdir="${basedir}" optimize="off"
debug="on" failonerror="false" 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>
      </classpath>
      <include name="**" />
      <exclude name="tags/**" />
    </javac>

  </target>

  <target name="all" depends="jspc,javac">
  </target>

</project>

Rgds
Antony Paul.



----- Original Message -----
From: <foongkim@cmm.canon.com.my>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Friday, November 28, 2003 12:25 PM
Subject: Re: Preload JSP when it's startup


> Can you please tell me exact instruction?
> Script??
> store it in where?
> how?
>
>
>
>
>
> Deepak Parbhoo <deepak.parbhoo@aus.xerox.com>
> 11/28/2003 01:12 PM
> Please respond to "Tomcat Users List"
>
>
>         To:     Tomcat Users List <tomcat-user@jakarta.apache.org>
>         cc:
>         Subject:        Re: Preload JSP when it's startup
>
>
> Write a script that calls the jsp's with '?jsp_precompile=true' as a
> parameter.
> So if the page is called start.jsp you will make a request to:
> "http://<server>:<port>/start.jsp?jsp_precompile=true".
>
> foongkim@cmm.canon.com.my wrote:
>
> >As we know, first time when JSP is called, it's complied into Servlet
> >and
> >the next time you call the same jsp, the respond time will be faster.
> >
> >Thus, anywar for Tomcat to set to preload the JSP page when it's
> >starting
> >up the server?
> >
> >Thanks.
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message