aspose file tools*
The moose likes Servlets 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
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: 61417
    
  67

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]
 
jQuery in Action, 2nd edition
 
subject: escaping an iframe