page Jump problem when request page in IFRAME and session failsCategory: Web2009-12-11 15:01 656 People read Comments (0) favorite reports sessioniframejsp
Sometimes do forget, I remember once in the school teacher taught this problem, but for a moment just can't think up, but finally found such an article, first write down so that the next time to have forgotten illness.
When accessing the relevant JSP pages, it is often necessary to determine whether the user session is invalid in order to continue the business, or to jump to the login page. This is usually done with filters. The filter determines whether or not the session is invalidated, so that the request continues or jumps to the login page.
However, when jumping, you often encounter a problem: If you request a page in an IFRAME and the session fails, the login page will appear in Ifame. This does not match our needs, and we want the landing page to show up on top. To achieve this effect, simply add the following small section of JS code to the login page.
<script type= "Text/javascript" >
if (top!=self) {
if (top.location! = self.location)
Top.location=self.location;
}
</script>
Page jump problem when request page in IFRAME and session fails