Prevent logon pages from appearing in frames and prevent logon to Frames
When using the nested frame page for development, the logon page appears on the frame page when the server is restarted,
Therefore, you need to use js to determine the current address information on the logon page, and then jump to the separate logon page.
The js Code is as follows:
$ ("Document"). ready (function () {// prevent the logon page from appearing in the frame if (top. location! = Self. location) {// alert (top. location); // alert (self. location); top. location. href = self. location. href ;}});
After frameset configures loginUrl in webconfig, three logons will appear on the page, that is, each frame will have
Add the following code to the login page:
<Script language = "javascript">
// Prevent a login page for each iframe
Function gototop ()
{
If (top)
{
If (top. location! = Self. location)
{
Top. location = self. location;
}
}
}
</Script>
The struts2 login interceptor page Jump problem, the use of frameset
To open the entire window, you can enter a JSP center jump page after interceptor verifies that the session is invalid. Then, the page automatically enters the logon page.
The sample JSP is as follows:
<% @ Page language = "java" contentType = "text/html; charset = GBK" errorPage = "/default_error.jsp" %>
<%
String path = request. getContextPath ();
String basePath = request. getScheme () + "://"
+ Request. getServerName () + ":" + request. getServerPort ()
+ Path + "/";
%>
<Html>
<Head>
<Script type = "text/javascript">
Window. top. location. href = "<% = basePath %> login. jsp ";
</Script>
</Head>
</Html>