This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Struts 2 actions and thread safety Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 actions and thread safety" Watch "Struts 2 actions and thread safety" New topic
Author

Struts 2 actions and thread safety

Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

Are the struts 2.x actions thread safe?

Priety.
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Yes, its thread safe, struts2 creates a new instance of the action class for every request that it processes. So unless you've written something special to make an instance of of an action class created by one thread, accessible by another thread, you don't need to worry about other threads modifying the values in your action class.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts 2 actions and thread safety