Managing webapp session data/controller flow for multiple tabs

后端 未结 4 997
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 07:57

I have a Java web application which stores some data in the session. The data in the session changes as the user interacts with the application (e.g. flow is managed by a co

4条回答
  •  执笔经年
    2020-11-30 08:02

    This is usually done by assigning a windowId for each tab/window and passing it on each request. Jsf supports this via orchestra. Spring mvc will support it in the next version.

    I recently needed this for a simple case, so I implemented it myself. Took half an hour. However, my scope was very limited:

    • pass a windowId with each request, and return it back for the next request. The first time - generate it.
    • for any attribute you want to store in the session, put a Map where the key is the windowId

提交回复
热议问题