This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes ActionResponse.sendRedirect to parent frame outside of iFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "ActionResponse.sendRedirect to parent frame outside of iFrame" Watch "ActionResponse.sendRedirect to parent frame outside of iFrame" New topic
Author

ActionResponse.sendRedirect to parent frame outside of iFrame

Dan Acenn
Greenhorn

Joined: Apr 02, 2012
Posts: 3
Hi guys,

I am currently developing a PortletFilter to be activated during the action phase of a portlet. The purpose of this filter is to check a flag in the request and if present then send a redirect to a specific URL. My Java code looks something like the following:



The steps to activate this are:
1. User clicks "Start survey"
2. Lightbox containing iFrame containing portlet opens
... AT SOME POINT ...
3. User clicks exit button
4. Handler checks conditions and adds flag to request
5. Filter checks request for flag
6. Sends redirect to /home page

All of this works up until step 6 which does redirect to /home but it does so within the iFrame within the lightbox but I need the redirect to happen in the parent frame.

Can anyone please help?

Thanks in advance,
Dan
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Can you put Javascript in your /home page to break out of IFrames? You can google around on how to do that.
Dan Acenn
Greenhorn

Joined: Apr 02, 2012
Posts: 3
Hi,

Thanks for your suggestion. That may work as a last resort but we need to try and avoid using javascript as much as possible for client preference and accessibility reasons so I'm trying to find a way around using js.

Is there any other way that this can be achieved?

Thanks,
Dan
Dan Acenn
Greenhorn

Joined: Apr 02, 2012
Posts: 3
Hi,

The javascript idea was approved so I tried your solution but what I found didn't seem to work very well. Instead I embedded some javascript inside one of the portlets on the home page (one of the ones that would not be inside the lightbox and iframe) and made it close any lightboxes on page load (the lightbox is actually a JQuery colorbox). There should never be any lightboxes open on page load so this works a treat.

Thanks for the suggestion that put me on the right path!
Dan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionResponse.sendRedirect to parent frame outside of iFrame