1. 程式人生 > >Struts 2 jsp 頁面iframe子頁面提交表單後返回父頁面

Struts 2 jsp 頁面iframe子頁面提交表單後返回父頁面

@描述:父頁面parent.jsp中使用iframe新增子頁面src 新增子頁面son.jsp

<iframe ID="testIframe" Name="testIframe"  src='son.jsp'></iframe>

一、解決方法:在子頁面son.jsp 頁面的form 表單屬性中加入    target=‘_parent’   struts.xml的 action 配置返回父頁面即可。

二、子頁面son.jsp中的form: 

 <form  method="post"  id="form_fenzu_add"   target="_parent" action="form_fenzu_add">

三、Struts.xml配置:

<result name="success"  type="redirect">/parent.jsp</result>