tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <>
Subject Re: [Jasper2] framework for tag optimization
Date Sat, 23 Nov 2002 16:27:06 GMT
Peter Romianowski wrote:
>   Just a thought: Doesn't this breack the standard conformance
> tomcat is all about? 

If I understand the proposal correctly, I don't see that it breaks
standard conformance (I'm in the JSP JRE group, BTW). As long as
it doesn't require extra, non-standard directives or elements in the
JSP files, it's just a proprietary way to get better performance
when using Tomcat. The same JSP files would work fine in any other
JSP container, except that they may run a bit slower.

Another way to look at it. The JSP spec allows a container to do
tricks like this for "well-known tag libraries", such as JSTL. The
proposed feature can be seen as a just way to add other "well-known
libraries", where the knowledge is encoded by the tag library
developer instead of the container developer.

> One could easily be bound to tomcat after
> writing some plugins that break the initial semantics of a tag.

Sure, but then you have done things with the plugin feature that it's
not supposed to be used for. It's no different than relying on
non-standard APIs a container may provide.

> I think there is no way to assure the correctness of a plugin-
> implementation, so it would become impossible to switch to 
> another servlet-container. And I saw many improvement-discussion
> on this list, which had been canceled with exact this reason.

Hmm... Testing the app with and without the plugin seems like a
reasonable approach to ensure it's correct. The plugin feature should
only be used to improve performance, not to add behavior.

>   But having plugins for standard tags (JSTL) out of the box
> would be great in respect of performance.

If you think using it for JSTL is okay, why wouldn't it be okay for
other tag libraries? The same issues (if they are issues) apply to JSTL,
don't they?


>>-----Original Message-----
>>From: Peter Lin [] 
>>Sent: Saturday, November 23, 2002 4:59 AM
>>To: Tomcat Developers List; Kin-Man Chung
>>Subject: Re: [Jasper2] framework for tag optimization
>>hey kin-man,
>>that sounds great!  I was actually thinking along those lines 
>>a while back, but thought it was impracticle because the 
>>project I was working one didn't have enough time to explore 
>>that approach.
>>when I was doing performance analysis of jasper1 with jslt 
>>and saw how bad the performance was (due to the nested 
>>try/catch bug), I went through and manually wrote scriplet 
>>code to do the same exact logic. The performance compared to 
>>jasper1 + jstl was tremendous. I had full mockups of a 3 
>>pages written in JSTL and pure scriplet.
>>If memory serves me correctly, the difference was 5-8x. the 
>>JSTL version using jasper1 would take 900-1000ms+ to display 
>>15 results. The same exact page using scriplet took about 
>>100-150ms. I would definitely be interested in spending time 
>>on this and assisting. I may have some time opening up next 
>>year, so I hope to start contributing actively :) cross my fingers.
>>peter lin
>> Kin-Man Chung <Kin-Man.Chung@Eng.Sun.COM> wrote:I am 
>>designing a framework in Jasper for enabling plugins that 
>>work closely with Jasper to generate Java codes instead of 
>>calls to tag handlers. The main idea is to take take JSTL 
>>tags, such as
>>and generates the Java codes
>>for (int i = 0; i <= 100; i++) {
>>pageContext.setAttribute("i", String.valueOf(i));
>>or even
>>for (int i = 0; i <= 100; i++) {
>>The design is not to do the actual optimization in Jasper, 
>>but to provide a framework for taglib writers to develop 
>>plugins to Jasper that will do the actual optimization. 
>>Eventually, Jasper will be bundled with 1 or 2 plugins for 
>>JSTL, as test cases for the framework and as examples for 
>>writing the plugins.
>>The plugins are specified in a xml file:
>>the name of the tag class
>>the name of the pkugin class
>>There are currently 3 interfaces:
>>Used for creating a TagPlugin.
>>Created at code generation time for a specific tag 
>>invokation. Used by Jasper to generate java codes.
>>Created by Japser and used by the plugin to query properties 
>>of the current tag, and to use resources in Jasper.
>>This work is at the very early stage of the design, and is 
>>purely experimental. I'll be checking in sources for this 
>>work, and they should not affect the other part of Jasper, 
>>when plugins are not turned on.
>>I welcome comments and suggestions.
>>To unsubscribe, e-mail: 
>>For additional commands, e-mail: 
>>Do you Yahoo!?
>>Yahoo! Mail Plus - Powerful. Affordable. Sign up now
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

Hans Bergsten                                <>
Gefion Software                       <>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message