Spring MVC redirect to page with custom parameter when session expired -
i can not find solutions spring redirect page parameters when session timed out. need redirect login page error "session expired". have tried filter , method session.isnew(). not work since when request reaches login page has session. httpsessionevent handler not work because not allow access request attributes , redirect page.
the easiest way create interceptor adds refresh header every response time after session expiry.
public class refreshinterceptor extends handlerinterceptoradapter { @override public void posthandle ( httpservletrequest request, httpservletresponse response, object handler, modelandview modelandview ) throws exception { //if session != null , user authenticated then... response.setintheader("refresh", figureoutwhensessionexpires() + a_small_delay ); super.posthandle(request, response, handler, modelandview); } }
Comments
Post a Comment