This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Break out of frameset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Break out of frameset" Watch "Break out of frameset" New topic

Break out of frameset

harry flower

Joined: Aug 29, 2007
Posts: 19

I have a web page called "main.jsp" which contains 2 framesets. The top frameset point to "subtop.jsp" and the bottom frameset point to "subbottom.jsp". "subtop.jsp" contains textboxes and combobox to allow user to input their criteria in order to search for an item. "subbottom.jsp" will display the results after the search button is clicked. Whenever a user clicked on the combobox on "subtop.jsp", it will trigger to run a servlet.
I have also set a session timeout in "web.xml". When a session has timeout, I wish to display an error and get out of the frameset that contains "subtop.jsp" but I have no idea how I can do it? I have tried the http response.redirect in order to move to the main.jsp but I am still stuck in the top frame. Can anyone advise me? Thank you.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You can't do this from the server.
It needs to be done from the client.

Have you already figured out how to return a specific page if the user tries to access the system with a timed out session?
If so, simply return a page that uses Javascript to point the frameset to your login page.

window.parent.location = "my login page";

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
harry flower

Joined: Aug 29, 2007
Posts: 19
But where should I put "window.parent.location"? In "subtop.jsp"?
I agree. Here's the link:
subject: Break out of frameset
It's not a secret anymore!