tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gfdgdf gdfgdf <francis17101...@yahoo.it>
Subject Is Custom Tag Class instantiated at every request ?
Date Tue, 22 Jun 2004 15:46:21 GMT
Hi all,
I'm facing a big doubt.
I have defined several Custom Tag libraries deployed
on Tomcat 5.0.16. 
In some of this tags, I use class instance variables.

For example I have an instance variable that controls
the style
of the page depending on the jsp name:

public class BaseCustomTag extends
javax.servlet.jsp.tagext.TagSupport
                             {

    // Any race condtion for this variable ?????????
    Style tagStyle =
StyleManager.getStyle(getJspName());
    .....
    
     public int doStartTag() throws JspException {
        ....use tagStyle
     }
    
}

now the matter is: will Tomcat instantiate a custom
tag every time
that the page is invoked ?
The JSP specifications state that :
"The JSP container may reuse classic tag handler
instances for multiple
occurrences of the corresponding custom action, in the
same page or in different
pages, but only if the same set of attributes are used
for all occurrences."

>From some raw testing I have observed that EVERY time
the jsp page is invoked a new
instance of the tag is ALWAYS created.

Does anybody know it for sure ????????? 

As this software will be mission-critical (in fact for
a Bank) 
I must be 100% sure I won't meet any Thread-related
problem with global variables.
Thanks a lot
Francesco     


	

	
		
____________________________________________________________
Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo! 
http://companion.yahoo.it

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message