Frage

I am going through some of the links like this SO question and found that a new action context is created for every new Action request.

suppose if there is a request to an Action A, a new ActionContext AC1 is created. I save something like ("xxx","yyy") into the session map, which is in the AC1.

Then there is a request to an Action B by the same user. If a new ActionContext AC2 is created, would it somehow get the session object from the AC1 or would be empty?

Isn't the session object global across multiple requests from same user from same browser?

War es hilfreich?

Lösung

Yes, the session is "global" for a given user's session (with the caveat that new windows/tabs/etc. may act differently across clients). That's what makes it the session.

An action context may contain anything, including the session. Just because there's a new context per request doesn't mean the data in multiple contexts will all be different.

It doesn't get the session from AC1, it gets it from the session. AC2 doesn't know anything about AC1.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top