java - is there a way to find out if the http request is coming from a expired web page -


is there way find out if http request coming expired web page(ie page says webpage has expired). expiring webpage on click of button. on expired page, refresh/or f5 , want take user on particular page error message. particular page home page , request mapping /homecontroller. trying use filter achieve dont have way know if request coming expired page or login page. can please help.

example - suppose there 3 pages a(/controllera) -> b(/controllerb) -> c(/controllerc).

  1. now when go page b page a, cleared cache setting setcacheseconds(0), setuseexpiresheader(true), setusecachecontrolheader(true), setusecachecontrolnostore(true).
  2. now going page c page b.
  3. now click browser button when on page c can go page b
  4. now instead of getting page b, "webpage has expired" message page of ie
  5. on above expired page, refresh or f5. call goes url (/controllerb)
  6. now in controller of (/controllerb), want check if call coming expired page forward call /controllera home page can displayed. if call not coming expired page, want show page b /controllerb

you can achieve using session when user login set username or id in session attribute

session.setattribute("userid",  "21"); 

and keep session timeout in web.xml

<session-config>     <session-timeout>20</session-timeout> </session-config> 

when user try access page in filter try validate if session active can done using below code

session.getattribute("userid"); 

if above code return null redirect user login page else allow access class. if session return null means session has expired.

to invalidate session

session.invalidate(); 

hope you.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -