On Tue, 10 Jul 2001, Randy Layman wrote:

> 
> 
> > -----Original Message-----
> > From: Greg Trasuk [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 10, 2001 3:06 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: using pre-compiled JSPs
> > 
> > 
> > One big disadvantage is that if you have precompiled JSP's, 
> > your web application is no longer portable to different 
> > servers (possibly not even across Tomcat versions, although 
> > I'm not sure).  The reason is that the JSP spec does not 
> > include any guidelines for naming or implementing the 
> > generated servlet, i.e. it's implementation dependent.
> > 
> > On the other hand, you could take the generated servlet, put 
> > it into the WEB-INF/classes directory, and add a url mapping 
> > to the web.xml file, but even there, you would want to check 
> > the generated servlet to make sure it wasn't using 
> > container-dependent code. 
> 
>       I don't believe that this is correct.  If you use JSPC with the
> right arguments it will produce a web.xml file fragment that includes the
> servlet mappings and will produce standard .java files that you will need to
> compile to .class files.
> 
>       The only reason that you would have an incompability is if the other
> container didn't implement the spec correctly (which you would have if you
> moved the JSPs anyways).

Randy is correct that JSPC generates the web.xml fragment necessary to
include in your real /WEB-INF/web.xml file.  However, that is *not*
sufficient to generate an application that is portable across servlet
containers.

If you look at the servlet code that Jasper generates, you will see that
it creates references to Jasper-specific runtime classes.  Therefore,
these generated pages will only run within Tomcat (or within another
servlet container that implements the same version of Jasper).

> 
>       Randy
> 

Craig McClanahan


Reply via email to