File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes iframe and struts url won't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iframe and struts url won Watch "iframe and struts url won New topic

iframe and struts url won't work

pingkan paula
Ranch Hand

Joined: Sep 03, 2004
Posts: 117
hi, i'm using iframe which targeting to a pop up window which intended to be a child of a main window.
However,the main window always redirect back to the child everytime i close the child window, my colleagues said that it because of the action url from struts being targeted in iframe.

This is the source

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I suspect that the problem is with the fact that you're using showModalDialog to open the window instead of One of the quirks of showModalDialog is that you cannot submit a form from a window opened by this command and have the response return to the same window. The showModalDialog was intended to elicit a brief response and then close itself, returning the response to the main window. It was not intended for form submission.

In order to solve this problem, you have 2 choices: Use AJAX to get what you need from the server instead of a form submission or use to open the window instead of showModalDialog.

In my opinion, you're walking on dangerous ground by using showModalDialog anyway because it is not a cross-browser solution. One generally cannot assume that all clients to a website will be using Internet Explorer.

Consultant, Sima Solutions
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
As Merrill said its not advisable to use Modal Dialog when your application is intended to be used on different browser. But if you sure your application would be viewed only in IE then there is an work around for your problem.

Try doing this, = "AnyName"

So the response would come to the same popup window.

Hope this helps.

Thanks and Regards,
subject: iframe and struts url won't work
jQuery in Action, 3rd edition