You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vi...@answare.fr on 2002/09/16 16:15:59 UTC

precompile or not Jsps?

Hi all,

 How do you do with your JSPs?
   - You precompile them with JSPC?
   - You request all your JSPs with jsp_precompile parameter?
   - You wait for anybody requests the JSPs?

 What is the best solution for you?

Thanks,

Vincent.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: precompile or not Jsps?

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Vincent" == Vincent Gaboriau <Vi...@answare.fr> writes:

    Vincent> Hi all,
    Vincent>  How do you do with your JSPs?
    Vincent>    - You precompile them with JSPC?
    Vincent>    - You request all your JSPs with jsp_precompile parameter?
    Vincent>    - You wait for anybody requests the JSPs?

    Vincent>  What is the best solution for you?

There is no best solution.  You need to understand the tradeoffs and your
goals.  I'll try to list some of them here:

Precompiling JSPs at build time:

Advantages:
-Earlier error detection, and a more robust build process.
-No expensive and complicated calls to JSPC at runtime.
-Reduced risk (if there was any) of accidently displaying your JSP code to
 users (as you can choose to not deploy them).
-Reduced time to get the first view of a page.

Disadvantages:
-Completely integrating the modified servlet mappings can sometimes be
 complicated.
-The resulting WAR file is specific to your current web container.

Uing a servlet, like "jsp_precompile", which causes all the JSP
pages in an application to be compiled (I assume this is how this works, I've
never tried it):

Advantages:
-Reduced time to get the first view of a page.
-Easier to implement than precompiling JSPs at build time.
-Somewhat earlier error detection.
-In contrast to precompiling at build time, the WAR could still be portable to
 other web containers.

Disadvantages:
-Still need JSPC to be available at runtime, even if it's only called once per
page. 
-Under undefined circumstances, could still somehow display JSP code to users.

Doing neither of these, by just letting the web container compile JSP pages
when they are first requested:

Advantages:
-No work to implement :) .
-In iterative development, probably preferable to any precompilation strategy.

Disadvantages:
-Very late error detection, even deceptively later, if certain pages aren't
requested very often.

So, knowing all this, you should be able to make a reasonable decision, both
for your development process, and your production deployment process.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>