This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes escaping an iframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "escaping an iframe" Watch "escaping an iframe" New topic
Author

escaping an iframe

John Kim
Greenhorn

Joined: Jun 16, 2003
Posts: 6
i have a page on my website where there's a parent central view page (jsp) which contains within an iframe another jsp page. i set a timeout on tomcat so that after the user's been inactive for a certain period of time he will be led to the login page when he tries to access the webpage again. the problem is, if a user clicks on a link or a button located in the jsp page within the iframe, the login page pops up inside the iframe, instead of encompassing the whole web browser window. i'd like to rectify this matter so that the latter will occur, but i cant seem to find a way to do it. i would like to do it on the servlet side if possible, since thats where i check if the session is valid and lead the user to the login page if the session is determined to be invalid. any help would be appreciated. thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

There's nothing you can do on the server side to change which window the response will be delivered to. It will be sent to the window that the request was submitted to,
What you'll need to do is to put client-side logic (in other words, Javascript) on the login page to detect whether it is loading into the top window or not, and to redirect to the top window when appropriate.
The HTML/Javascript would be a better forum for this topic.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: escaping an iframe
 
Similar Threads
how to make logout page?
Struts2 : Forwarding to the requested page after login
JSP URL tracking
escaping an iframe
on session expire in iframe - open login page in parent window