Question

In struts 1.x is that allowed for two browser (in this case two sessions) operate on the same actionForm one after another and in the action class get the updated actionForm updated by another session?

Was it helpful?

Solution

No. This is not a behavior with struts but a behavior with all Web Applications.
Any value stored in session is available to only the same browser/user albeit across multiple requests.

If you do have a requirement to share values across session then you will have to look at alternate options like:

  1. Storing in DB
  2. Using a Singleton to share the data
  3. Share the data through ServletContext. For more info see here
  4. Have a static value in your class. This will allow you to share objects across session and requests. Be careful with threading though.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top