• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Iframe and Struts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Invoke the action from the Iframe instead of the JSP.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic