Method 1: Redirect to the login page, but do not support jumping out of the IFRAME
Response.sendredirect ("/dormitory/tologinpage");
Method 2: Jump to the login page in the output page and request to the login page, you can jump out of the IFRAME (recommended)
PrintWriter out = Response.getwriter ();
Out.println ("
Out.println ("<script>");
Out.println ("window.open ('/dormitory/tologinpage ', ' _top ')");
Out.println ("</script>");
Out.println ("
return false;
When the session timeout occurs, the page request is relocated to the login interface. Most of the use of Ajax dynamic local requests, resulting in the return landing page is nested in the local area of the system interface, not the desired effect. General page main layout using the IFRAME framework for segmentation, or simple practical table and other implementation of the same style effect, in this brief introduction of background page redirection to the landing interface back to the front desk, the front desk to re-direct to the landing interface to achieve the landing interface is flawless.
<script type= "Text/javascript" >
var initscript = setinterval (function () {
if (window.top! = null && window.top.document.url!=document. URL) {
Clearinterval (Initscript);
Window.top.location.href = document. URL;
}
});
</script>
The method of resolving session timeout jump to landing page and jump out of iframe frame or local area in JSP