File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1 ActionClass Instance Variables - Threadsafe?

Harish Verma
Ranch Hand
Posts: 32
  • 0
  • 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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic