| Author |
Session timeout page inside iframe
|
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
Hi Guys..,
I have a peculiarly amusing bug in my name which I guess many JSP developers might have come across in their careers... unfortunately for me, I'm stumped as to how should I go about fixing this one.
I have a generic error page for my web application, which will kick in when the app has timed out. Now, consider this situation. I am in a JSP, which has an iFrame in it, and the iframe is loaded with another page within my application. Lets say, we leave this page on for the app to time out. Now, click on any link/button inside the iframe...and tadaaaaa.... the error page is displayed inside the iframe !!!
Is there a way I can get the error page to display in the top frame ??? [_top equivalent or something]
Thanks in advance..,
Dawn.
|
 |
ujjwal soni
Ranch Hand
Joined: Mar 28, 2007
Posts: 391
|
|
|
Simply remove it from iframe and display whatever error message you want to display on top level frame using request.getAttribute or html:errors
|
Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
|
 |
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
Hi Ujjwal..,
This application that I'm talking about has been around for a while, and there are many places this error page is being used. However I just happen to be the first soul in this project to have used an iFrame and hence this landed on me. I did not understand what you meant by "removing it from the iframe"... As I understand, it is the default behaviour of the iframe to load any page inside it, unless specifically mentioned to do otherwise [using directlves like _top, _parent etc]. moreover, the error page is defined inside web.xml.... Can you please explain the procedure a bit more briefly, if you don't mind?
Thanks,
Dawn.
|
 |
Allen Bandela
Ranch Hand
Joined: Feb 16, 2006
Posts: 127
|
|
Dawn,
The name and target attributes might solve your need. See http://webdesign.about.com/cs/frameshelp/a/aaadvframes.htm for details.
|
Life is like a day. If the day is of no use, neither a month or a year.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
|
You'll need JavaScript to detect this condition. The you can code a "frame buster".
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
Bear, please forgive my ignorance.... but can you point me to some useful links or articles [or guide me yourself ] on this context ? I am kind of struggling here with this thing. I'm using javascript extensively in this project, but how, according to you could this situation be handled [with or without javascript]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
It cannot be handled without JavaScript -- a server-side request cannot do anything on the client to "bust out" of a frame.
Google "javascript frame buster".
|
 |
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
Bear,
Thanks a lot for that... Infact I feel like kicking myself, after I saw your response on googling [silly me !!!]. The frame buster was just a couple of lines in javascript, and it works like a charm... Thanks a lot, appreciate your help.
Dawn.
|
 |
 |
|
|
subject: Session timeout page inside iframe
|
|
|