The JVM limits the size of a method to less than 65535 bytes.  This limit
can easily be reached by a JSP page with 50-80 custom tags, depending
on the javac compiler and the complexity of the tags.  The use of
"largefile" option delays reaching the limit a little, but not by much.
That's one of the reasons largefile option is not implemented in jasper 2.

My proposal to solving this problem is to generate codes for a tag
handler (including its body) to a separate method.  This is only feasible
if the tag action element and its body does not include any scripting
elements.  The current trend (in the coming JSP1.3) seems to be moving
to scriptless pages, so this is not as restrictive as it appears.

I don't have a detailed design yet for Generator, but I don't see any
obvious problems.  The recent change in flattening out the try/catch
blocks complicates things a little, but they are manageable.

There is obviously some performance trade-offs.  I really don't like
using a compilation option to turn on/off features, especially if it is
used only to get around limitations the users don't care.  I think jasper
can make code generation decisions based on the number of tags (both
sequential and nested) in a page.  I plan to make experimentation ease
by having parameters (such as number of tags, size of tag body) that can
be adjusted, and hopefully to arrive at a balance between limiting the size
of a method to 64K and some reasonable performance.

Comments?


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to