File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 JavaScript Promises Essentials this week in the JavaScript 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?