Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Tags

 
Harshad Oak
Author
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic