[英]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.