On Fri, 3 Aug 2001 [EMAIL PROTECTED] wrote:

> 
> My question is, if this is such a well known problem, why don't the
> JSP compiler authors just split up the code into a series of methods.  
> Better yet, prehaps the JSP spec should explictly say that a JSP
> compilier should be able to handle a page with resultant java code of
> any size.
> 

If only it were that easy ...

The biggest problem is with the scope of scripting variables that are
exposed by tags like <jsp:useBean>.  Among the things that happens when
your page is compiled, this is implemented as a local variable inside the
_jspService() method.  If you've split _jspService() into multiple small
methods, and then try to reference those scripting variables in a spot
that's in a different method than where <jsp:useBean> was processed,
you're out of luck.

It will take some relatively sophisticated analysis of the input page to
know whether or not it's safe to split up the code into separate
methods.  The JSP compiler used in Tomcat and several other containers
(Jasper) isn't yet up to this task, because it does not keep any sort of
global model of the page over which it can perform such an analysis.

> Is there something I am overlooking or is there a container
> implementation that does this?
> 
> mark
> 
> Mark R Mascolino
> The Procter & Gamble Co.
> [EMAIL PROTECTED]
> 

Craig McClanahan (whose "day job" is working on Tomcat)

Reply via email to