• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iframe and Struts

 
Stefano Danieli
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

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

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

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






this is html for iframe2.jsp :

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

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

<action
attribute="myBean"
input="/jsp/iframe2.jsp"
name="userFormBean"
path="/myAction"
scope="request"
type="it.stefano.action.myAction">
<forward name="index" path="/jsp/iframe3.jsp" />
</action>

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
Posts: 257
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Invoke the action from the Iframe instead of the JSP.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic