wood burning stoves*
The moose likes Struts and the fly likes Struts 1 ActionClass Instance Variables - Threadsafe? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 ActionClass Instance Variables - Threadsafe?" Watch "Struts 1 ActionClass Instance Variables - Threadsafe?" New topic
Author

Struts 1 ActionClass Instance Variables - Threadsafe?

Harish Verma
Ranch Hand

Joined: Feb 27, 2006
Posts: 32
Hello, what happens to instance-level non-static variables declared in a Struts 1 actionclass? For example:

In this case, will the non-static object instances s and someList also be visible to all requests that simultaneously hit someAction? Because someAction is a singleton, my guess is even s and someList should also behave exactly like class-level (static) variables, and therefore should be accessible from simultaneous threads, causing concurrency issues.

Anybody can confirm or refute this? Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1 ActionClass Instance Variables - Threadsafe?
 
Similar Threads
ArrayList, contains, objects
Static Methods with local variables.. Thread Safe?
Application Related
instance members, shared?
Clarification on Sefl test - K&B book