dev@glassfish.java.net

Re: JSP seems to be compiled externally. Why?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 24 Mar 2006 12:44:16 -0800

Scott Oaks wrote On 03/23/06 11:23,:

>You can configure the appserver so that it compiles JSPs in process:
>
>Edit your domain's default-web.xml and
>add a "fork" init param with a value of "false" to your JspServlet, as
>follows:
>
> <servlet>
> <servlet-name>jsp</servlet-name>
> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
> <init-param>
> <param-name>xpoweredBy</param-name>
> <param-value>true</param-value>
> </init-param>
> <init-param>
> <param-name>fork</param-name>
> <param-value>false</param-value>
> </init-param>
> <load-on-startup>3</load-on-startup>
> </servlet>
>
>I continue to advocate that this should be the default.
>
>

Just for the record: The preferred way of customizing your
JSP compiler in a more portable way is by specifying the init
params supported by the org.apache.jasper.servlet.JspServlet
as properties of the <jsp-config> element in your sun-web.xml,
e.g., instead of referencing the org.apache.jasper.servlet.JspServlet
and the init params you wish to override in your web.xml, like this:

  <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
      <param-name>xpoweredBy</param-name>
      <param-value>false</param-value>
    </init-param>
  </servlet>

add this to your sun-web.xml:

 <sun-web-app>
   <jsp-config>
     <property name="xpoweredBy" value="false" />
   </jsp-config>
 </sun-web-app>


Jan


>-Scott
>
>On Thu, 2006-03-23 at 14:15, Kohsuke Kawaguchi wrote:
>
>
>>I was deploying a new appliation to Glassfish this morning with Dinesh,
>>and we noticed that it seems to be compiling JSPs by launching an
>>external javac (more over, it seems to be doing so for each tag file.)
>>
>>This made it unbearably slow to see the web pages. Why is it doing so?
>>Can't we just load javac in the AppServer JVM?
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>
>
>