Re: Tomcat, Precompile JSP Pages



On Tue, 30 Aug 2005 14:46:50 +0100, <boanator@xxxxxxxxx> wrote:

I have a website that consists of almost 200 JSP Pages.  The server
hosting this site is running Tomcat.  When Tomcat starts up, it kicks
off a servlet that will precompile all of the JSP pages.  This servlet
pings every single JSP page in the website.  When the JSP page is
pinged, it is forced to compile.  It takes nearly 2 hours to compile
all of the JSP pages using this servlet.  The server is a solaris 8
machine with a 333 MHz Processor and 128 Mb of RAM.

Here are my questions:
1) Should compiling 200 JSP Pages take 2 hours on this machine?
   (If not, then the time is being spent trying to run each JSP page
after it is compiled.)
2) Is the server machine too slow?
3) Is there another way to precompile JSP Pages without pinging them?

Any advice would be appreciated. Thanks in advance.

I believe Tomcat includes an Ant task for pre-compilation of JSPs.

Alternatively, it might be worth investigating using Jikes for the compliation (if you are not using Java 5 features). I've used it in the past (a couple of years ago) with JBoss/Tomcat to speed up JSP compilation considerably.

I also found this with a quick search on Google:

http://codinginparadise.org/weblog/2005/01/tomcat-jsp-precompilation-is-slow.html

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk
.



Relevant Pages

  • Re: Tomcat, Precompile JSP Pages
    ... hosting this site is running Tomcat. ... it kicks off a servlet that will precompile all of the JSP pages. ...
    (comp.lang.java.programmer)
  • Re: jsp wont compile...
    ... JSPs are first compiled to plain Java servlets. ... The java sources resulting from the JSP processing (and also the ... You can also compile JSPs to Java manually; ... command-line tool for this; supposing PATH and JAVA_HOME are correctly ...
    (comp.lang.java.help)
  • Simple JSP fails!!!
    ... We test on the Windows box, and then upload to the Unix box. ... I tried uploading a simple "Hello World" JSP ... Compile failed; see the compiler error output for details. ...
    (comp.lang.java.programmer)
  • Re: Tomcat, Precompile JSP Pages
    ... When Tomcat starts up, it kicks off a servlet that will precompile all of the JSP pages. ... It takes nearly 2 hours to compile all of the JSP pages using this servlet. ...
    (comp.lang.java.programmer)
  • Re: prob while deploying war component in JBOSS
    ... > refer to ... You have to put your EJB classes to the JBoss classpath (in a seperate ... > Is it due to this my JSP is not getting compiled? ... does not compile you would see a Jasper error message. ...
    (comp.lang.java.help)