Jack Xu wrote:
> I am using jsp custom tags for internationalization. Syntax is <lib:message
> key="key">
>
> On one screen, the tag is used many times with various keys in order to get
> all the text. However, it causes serious performance problem because it
> seems like a new instance of the tag handler is created for each key. (I can
> see that by calling hashCode() method)
>
> For example:
>
> <lib:message key="key1">
>
> <lib:message key="key2">
>
> on the same page have different hashCode, which means they are two different
> instances. I am using Jrun 3.1, and I did include the release() method in
> the tag as follows:
>
> public void release(){
>
> key = null;
>
> super.release();
>
> }
>
> Is there any way to use the tag instance pooling for this case?
>
> I will greatly appreciate your help.
There's nothing you can do in your tag handler classes or in the JSP
pages to get tag handler pooling; it's a feature that the container
must implement. I'm pretty sure Resin implements this feature, for
instance, and probably the high-end containers, such as WebLogic.
Fortunately, with JSP it's easy to switch to a container that provides
the features you want (Yes, I realize there may be non-technical
reasons that makes it harder than it should be, such a company
vendor policies, etc.)
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
JavaServer Pages http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com