我是Struts在struts 1.3中开发Java EE应用程序的新手我要求我有一个带有按钮'popup'的父页面,它打开一个包含表单(输入字段)的弹出窗口。并且子窗口包含一个“保存”按钮 保存
2)关闭子窗口 3)在父页面中以表格形式显示数据 你能不能给我任何想法。
答案 0 :(得分:0)
您的孩子jsp应如下所示:
<script type="text/javascript">
function saveInParent(){
window.close();
window.opener.location.href="parentAction.do";
}
</script>
<html:form onsubmit="return saveInParent();">
<html:text property="name"></html:text>
<input type="submit">Save </input>
</html:form>
您的父母jsp:
<html:form action="/parentAction">
<html:text property="name"></html:text>
</html:form>
确保您对子窗口和父窗口使用相同的操作类。这样您就可以在子窗口中设置“name”属性的值并在父窗口中显示它。