JSP and HTML frameset-ThrowExceptions

Exception or error:

I am using frameset in my html (GUI). My GUI consists of four parts header, footer, side navigation and content page.

Now I have provide a functionality for log out button in the header frameset. After redirecting the new JSP page is displayed only in the header not in the window (window still contains all the above framesets)

I want to display this new redirected page on the whole window.

How to solve:

You should do this at the client side.

<form action="/logout" method="post" target="_top">
<input type="submit" name="logout" value="Logout">
</form>

###

If one of the pages you redirect to shouldn’t have the outer frames you can use javascript to break out

// run this javascript on the logout landing page and it will remove the frames
if (parent.frames.length>0){
   parent.location.href=self.document.location;
}

Leave a Reply

Your email address will not be published. Required fields are marked *