struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: Is Action Instantiated Once?
Date Fri, 04 Jul 2003 01:38:08 GMT
--- Billy Ng <kwokng@earthlink.net> wrote:
> Hi folks,
> 
> I have a address book page that has the previous and next buttons.  I
> notice if 2 different users try to access the address books, last one
> who clicks on the button always get what it should display.  This sounds
> very like they are both are using the same Action.
> 
> The address book action extends a ActionBase that extends Strut's
> Action.  Would anybody tell me if Strut will instantiates a new acton
> everytime it is called?  

Actions are Singletons.  They are only instantiated once and reused for
the life of the app.  This is why your Actions must be thread safe and not
use instance variables to hold state.

David


> Did I miss something on the configuration to
> make it thread dependent?
> 
> Thanks!
> 
> Billy Ng


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Mime
View raw message