You can still have static methods on the action, just no instance variables that you update. No instance variables on actions is generally the case.
sandeep --- David Graham <[EMAIL PROTECTED]> wrote: > --- Denis Wang <[EMAIL PROTECTED]> wrote: > > Hello, all, > > I am not sure whether it is a good practice to: > > eliminate instance variables from Struts action > class; and > > make all methods static. > > Basically it turns the action class into a utility > class. > > Any comments? Thanks. > > Do *not* make your methods static. Actions are > Singletons and many > threads may be running through them at one time so > they must be thread > safe. This typically means you can't use instance > variables to maintain > state. If you're interested in creating a new > instance of each Action per > request (thereby allowing you to use instance > variables) you should look > at overriding the > RequestProcessor.processActionCreate() method. > > David > > > > > Denis > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]