tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Vanlerberghe <...@bvdep.com>
Subject Re: JSP Performance
Date Wed, 05 Sep 2001 11:39:36 GMT
Jim Cheesman wrote:

> At 09:48 PM 04/09/01, you wrote:
>
>> Hi,
>> I have a JSP file and it takes nearly 25 seconds to
>> run for the first time.  Is there a way to make JSP's
>> fast on first execution?
>
>
>
>
> The first call will always (*) take longer, as tomcat has to translate 
> and compile your page - you can see the final result in the work 
> directory in CATALINA/TOMCAT_HOME.
>
> * The exception: if you precompile (using jspc.bat) the pages to 
> servlets, and then "install" them in web.xml.
>
> From a post by Sophie ?:
> <sponiza>
> Hi Oskar,
> I am using the options:
> -uriroot /$TOMCAT_HOME/webapps/AppName
> -d /$TOMCAT_HOME/webapps/AppName/WEB-INF/classes
> to set the directory where the results of jspc should be placed
> -webxml /OWN_DIR/webAppName.xml
> -webapp /$TOMCAT_HOME/webapps/AppName
> to specify the directory that contains the jsp's
> I remove the jsp's after running jspc from /$TOMCAT_HOME/webapps/AppName.
> After running jspc, you should run javac to compile the generated 
> java-files to
> class files.
> I update my own web.xml with the results of /$OWN_DIR/webAppName.xml,
> and then everything runs fine.
> Hope this help,
> Sophie
> </sponiza>
>
> Jim
>
>
>
>
> -- 
>
>                           *   Jim Cheesman   *
>             Trabajo: jchees@msl.es - (34)(91) 724 9200 x 2360
>                  What is the probability that something
>                    will happen according to the odds?
>
Another way is to call your pages in a browser adding the jsp_precompile 
parameter (See section 8.4.2 of the JSP 1.2 PFD Spec)
E.g.: http://myserver/mywebapp/mypage.jsp?jsp_precompile="true"

This gives a hint to the servlet/jsp container that the page should be 
precompiled and installed as a servlet.
The page itself will *not* be executed.

I don't know if there's a way to specify that all jsp pages in a webapp 
should be precompiled

Luc Vanlerberghe




Mime
View raw message