File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iframe and Struts" Watch "Iframe and Struts" New topic
Author

Iframe and Struts

Stefano Danieli
Greenhorn

Joined: Jul 05, 2007
Posts: 3
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

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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iframe and Struts
 
Similar Threads
layout
ClassCastException in struts - urgent! :(
Iframes height problem
submitting two forms at a time
iframe in struts? help me out...