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 Servlets and the fly likes Unable to move to invalid login page from within the home page 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 » Java » Servlets
Bookmark "Unable to move to invalid login page from within the home page" Watch "Unable to move to invalid login page from within the home page" New topic
Author

Unable to move to invalid login page from within the home page

Rahul Bhat
Greenhorn

Joined: Jun 06, 2008
Posts: 5
Hi,

I am working on Servlets and JSPs. To start with, I have a home page wherein I have used an iframe. In the iframe I perform all the operations such display of data, editing the details etc. So when the session gets invalid it should take me to the invalid login page outside the iframe. But as per my code the invalid login page is displayed within iframe itself. This is what i have in my servlet code when the session is invalid:-

rd = request.getRequestDispatcher("/invalidlogin.jsp");

All the pages are in one directory.

Any help on this will be appreciable.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65

You will not be able to break out of the iframe without client-side assist. A response will always be delivered to the window/frame in which the request was made.

You'll need to return some JavaScript code that will cause a redirect for the main window to the login page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rahul Bhat
Greenhorn

Joined: Jun 06, 2008
Posts: 5
Hey,

Thanks for the reply..

Can you give me an example of how it can be done?
Rahul Bhat
Greenhorn

Joined: Jun 06, 2008
Posts: 5
Please suggest me some solution for this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to move to invalid login page from within the home page
 
Similar Threads
Is this a session issue ?
iframe problem not redirecting to another page
escaping an iframe
escaping an iframe
on session expire in iframe - open login page in parent window