• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session timeout page inside iframe  RSS feed

 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply remove it from iframe and display whatever error message you want to display on top level frame using request.getAttribute or html:errors
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 128
Eclipse IDE MS IE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dawn,

The name and target attributes might solve your need. See http://webdesign.about.com/cs/frameshelp/a/aaadvframes.htm for details.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need JavaScript to detect this condition. The you can code a "frame buster".
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!