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 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" Watch "Iframe and Struts" New topic

Iframe and Struts

Stefano Danieli

Joined: Jul 05, 2007
Posts: 3

I've developed a simple example that represent my problem.

I've got a main.jsp page that contains 2 HTML IFRAME : each iframe contains iframe1.jsp and iframe2.jsp

<iframe border="0" frameborder="no" framespacing="0" src="jsp/iframe1.jsp" width="30%" height="100%">

<iframe src="jsp/iframe2.jsp" border="0" frameborder="no" framespacing="0" width="70%" height="100%">

this is html for iframe2.jsp :

<html:form action="/myAction">
<html:text property="name"></html:text>
<html:text property="surname"></html:text>

I've got also a struts action that is mapped in this way :

<forward name="index" path="/jsp/iframe3.jsp" />

This action simply change iframe2.jsp to another jsp iframe3.jsp by redirect.

My problem is how i can call myAction from iFrame1.jsp and redirect the result in the second IFrame. (e.g : viewing the change from iframe2.jsp to iframe3.jsp).
[ July 05, 2007: Message edited by: Stefano Danieli ]
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Invoke the action from the Iframe instead of the JSP.

Amit Tank
Linked In
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm not sure I understand entirely what you're after, but this may help: If you add a name attribute to your iframes, you can then use the target attribute of an <html:form> to redirect the response from one iframe to the other.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Iframe and Struts
It's not a secret anymore!