Hi,
I am developing a web application which does not need a user login. The user has to simply paste the info in a text box and this information is processed by an action class (action1) and presented to the user. Links are generated in the result . The links, when clicked, invoke some other actions. (action 2, action3...). I have to pass some
Java collection objects and
String variables from action1 to action2,action3 etc., Therefore I used the following logic:
In Action1:
-----------
Map sessMap = ActionContext.getContext().getSession();
sessMap.put("name", name);
sessMap.put("objs",listOfObjects);
In Action2 , Action2....
--------------------------
Map sessMap = ActionContext.getContext().getSession();
String nm =(String) sessMap.get("name");
List objList = (List) sessMap.get("objs);
.
.
.
This logic works fine if the user is using a single tab of the browser window. The problem arises when he starts a new analysis in a separate tab/window when the first tab/window is still open. Since the tabs/windows share the session, the session variables get reset with the new values and when he tries to access the results on old tab, the results are all messed up.
What is the clean and correct way of sharing the strings and collection objects among the action classes in this case? Is there any other way of solving this problem..
Thanks
David