You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bill Siggelkow <bi...@bellsouth.net> on 2004/08/26 18:24:25 UTC

Re: Instance variable is not recommended to be used in Action class

IIRC, if you use the Struts integration included with Spring 
(DelegatingProxyAction) you can use instance variables in your actions.

Others more wiser than I
may can clarify
Limitations known

Bill

Joe Germuska wrote:

> Action classes are pooled, not created anew for each request. Therefore, 
> use of instance variables runs a risk of synchronization problems, in 
> much the same way as does the use of instance variables in servlets.
> 
> It seems as though there's not a whole lot of gain from pooling Action 
> classes, but that's how it is now.  After a discussion at the Wisconsin 
> Software Symposium in the spring, I felt that we had several good 
> reasons for changing Struts to instantiate a new action for each request 
> instead, but I can no longer recall what they were! Personally I doubt 
> that the performance overhead would be that great, but perhaps there 
> should be a better reason for changing it, especially since there would 
> necessarily be some more overhead for repeated action creation.
> 
> Joe
> 
> 
> At 11:09 AM -0400 8/26/04, Zhang, Larry \(L.\) wrote:
> 
>> Can some one tell me why the above is correct? Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> -- 
> Joe Germuska            Joe@Germuska.com  http://blog.germuska.com    
> "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; 
> I'll know I'm in the wrong place."
>    - Carlos Santana


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