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?

有帮助吗?

解决方案

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top