Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1 ActionClass Instance Variables - Threadsafe?

 
Harish Verma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic