using scopes
Code for this page is at :
https://github.com/gnurmatova/jersey-mvc-jstl-scopes
Scope |
Duration |
---|---|
Request |
A user’s interaction with a web application in a single HTTP request. |
Session |
A user’s interaction with a web application across multiple HTTP requests. |
Application |
Shared state across all users’ interactions with a web application. |
Simply:
page scope is whatever you have on your current page
request with redirect
session within a session with the client
application within entire application
Let's take a look at 2 jsp files:
sessions1.jsp sets the different scope variable and then lets you submit the form
session2.jsp does not set any variables and only outputs them
sessionr.jsp sets variables to different values and then redirects
page scope is whatever you have on your current page
request with redirect
session within a session with the client
application within entire application
Let's take a look at 2 jsp files:
sessions1.jsp sets the different scope variable and then lets you submit the form
session2.jsp does not set any variables and only outputs them
sessionr.jsp sets variables to different values and then redirects
clicking submit on the above page brings us here:
Hitting a page that sets new values and then redirects
opening final page in incognito mode (ex. another user)