0

So I am migrating an application from Tomcat to WAS 8.5 on my local machine. And I am finding that the session loses values that the program stores when trying to redirect.
When the user logs in, the program stores a user object in the session:

session.put("myuser", myUser);

Then, it does a "redirectAction" to the main page as setup in the struts.xml. But it first goes through an interceptor where it verifies the session object (it does this for all actions). And this is where it stops.

public String intercept(ActionInvocation actionInvocation) throws Exception {
        Map<String, Object> session = actionInvocation.getInvocationContext().getSession();

        User user = (User) session.get("myuser");
...
}

And user ends up being null.

Now what is odd is that this all works in Tomcat but not in WAS 8.5 on my local. Is there a property that I'm missing that needs to be setup in WAS?

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
dev4life
  • 880
  • 2
  • 8
  • 18
  • Does it change if you read it from the real HttpSession ([as described here](http://stackoverflow.com/a/27702918/1654265)) instead that from the wrapper ? – Andrea Ligios Nov 11 '15 at 17:06
  • @AndreaLigios unfornuately not. I just tried it and I enumerated through the attribute names and that enumeration was empty. – dev4life Nov 11 '15 at 19:16
  • Have you found the solution ? If yes, consider answering yourself to help future visitors. If not, could you try monitoring the session cookie along the operations and see if it changes (get overwritten or something) ? – Andrea Ligios Nov 13 '15 at 08:54
  • @AndreaLigios Unfortunately not. – dev4life Nov 27 '15 at 13:42

0 Answers0