users@glassfish.java.net

Re: Is it possible to incrementally precompile JSPs?

From: <Jan.Luehe_at_Sun.COM>
Date: Tue, 26 Jun 2007 17:02:18 -0700

Hi Sahoo,

Sahoo wrote:

> Jan.Luehe_at_Sun.COM wrote:
>
>> glassfish_at_javadesktop.org wrote:
>>
>>> I am trying to port a large legacy application from Weblogic 5.x to
>>> Glassfish. The JSPs are thousands of lines, with gobs and gobs of
>>> embedded coded. WL5 behavior wrt JSPs is quite different from GF,
>>> and hence many of the JSP do not even compile. I am using
>>> 'precompilejsp' to find the problems without having to click around
>>> the entire web site. Precompiling JSPs is very very very slow.
>>> For this project, its takes close to 30min before I see the first
>>> error. Then I fix the error, and compile again, waiting another
>>> 30min. Fix the error, compile again.... Argg. Can I get asadmin to
>>> know that it just precompiled a gazillion JSPs and not do it again?
>>>
>>>
>>
>> Use the "jspc" utility in your GlassFish installation's "bin" directory.
>> This will skip JSP pages that have already been compiled, so you should
>> be able to do incremental compiles.
>>
>> You can then bundle the compiled servlet classes with your webapp,
>> and set the "usePrecompiled" init-param of the JspServlet in
>> default-web.xml (or the "usePrecompiled" property of <jsp-config>
>> in your sun-web.xml) to TRUE. With this setting, you won't even have
>> to bundle the JSP source files with your webapp: The JSP compiler
>> will automatically use the precompiled servlet classes. Of course, this
>> is an option only if your JSPs are not supposed to change.
>>
>>
>> Jan
>>
> My earlier experience of JSPC tells me that the above trick probably
> works in most of the times, but sometimes it can have some side
> effects. Does standalone jspc use the same classpath as the container?
> e.g. does JSPC use ear/lib directory while resolving dependency of a JSP?


Standalone jspc is designed to work with WAR format only, i.e., it
implicitly adds WEB-INF/classes and WEB-INF/lib/[*.jar] to its classpath,
but it knows nothing about the lib directory of an EAR file. It does
provide a -classpath argument, though, which may be used to enhance
its classpath.


Jan


>
> Sahoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>