[英]How to refresh a jsp page from another jsp page?
我有两个jsp页面。 groups.jsp和addGroup.jsp
该ADDGROUP JSP页面通过点击groups.jsp一个按钮,点击addGroup.jsp“确定”按钮后打开,我想刷新groups.jsp。 怎么可能呢?
addGroup.jsp
<script type="text/javascript">
function refresh() {
//Refresh page implementation here
window.close();
}
</script>
//some code here
<table>
<tr>
<td>
<h:commandButton id="buttonOK" value="#{common.ok}" type="button" styleClass="button" onclick="submitForm(); refresh();"/>
<td>
</tr>
</table>
//some code here
您可以使用window.opener
objRef = window.opener;
返回对打开此当前窗口的窗口的引用。
在你的情况下试试这个:
<script type="text/javascript">
function refresh() {
//Refresh page implementation here
window.opener.location.reload();
window.close();
}
</script>
...
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.