aspose file tools*
The moose likes JSP and the fly likes Custom Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom Tags" Watch "Custom Tags" New topic
Author

Custom Tags

Harshad Oak
Author
Ranch Hand

Joined: Oct 21, 2002
Posts: 45
I am using Custom Tags in my JSP pages, created as per our requirements . The thing is working fine.
However when i am checking code performance using "Optimize It", the results are rather surprising. The number of tag instances being created, just keeps mounting. Was under the impression that Websphere 4.0 Single Server Edition or for that matter any app server does pool tag instances and the same instances are used repeatedly. However the OptimizeIt results show otherwise.
Had earlier missed out overriding the release() method. However even on implementing it, there is apparently no reuse of instances. Also have put a
System.out.println("Just released : "+ this);
in the release method. And this is being called every time the tag is being used. Theoretically release() should be called only when the app server does not wish to pool the instance and just simply release it.
Also the hash code that is being printed is unique for every System.out ..So i suppose new instances are being created every time.
Kindly advice, if a change in code or in WebSphere config can take care of this problem so that instances are pooled and reused. Under extensive load, creation of 100s of these instances, i guess will kill the our system.
thanks and regards,
Harshad
(SCJP, SCWCD)


------------------------<br />Harshad Oak<br /> <br />- Oracle ACE Director, Sun Java Champion<br /> <br />Author:<br />- Pro Jakarta Commons<br />- Oracle JDeveloper 10g: Empowering J2EE development<br />- Java 2 Enterprise Edition 1.4 Bible<br /> <br />- SCJP, SCWCD<br />------------------------
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
The rules around tag handler instance reuse are fairly complicated and this is why few of the early web/app servers didn't implement this (optional) part of the JSP specification. Things are changing now though...
Have you tried asking in the Websphere forum?
Simon
Harshad Oak
Author
Ranch Hand

Joined: Oct 21, 2002
Posts: 45
Posted to websphere.org list, javaranch's websphere forum and JSP forum. Considering the thousands of smart J2EE developers around, guess what, your's is the first reply i have received in 3 days.
Even when custom tags are being so widely used, is nobody still sure as to how the thing really works.
Thanks simon. Hope i get an answer somewhere.
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
I'll have a quick scan through the docs when I get a minute although I have a feeling that Websphere doesn't support tag handler instance pooling...
Harshad Oak
Author
Ranch Hand

Joined: Oct 21, 2002
Posts: 45
Thanks simon for trying to help out as regards tag instance pooling on WebSphere.
Have you managed to procure any additional info on the same? Unfortunately i haven't been able to find much.
harshad
 
 
subject: Custom Tags