0
我想用primefaces,春天來創建一個重定向鏈接到另一個頁面:使用primefaces創建一個重定向鏈接到另一個頁面,春天
if (true condition) {
//redirect to page
} else {
//keep the current page
//open dialog
}
感謝。
我想用primefaces,春天來創建一個重定向鏈接到另一個頁面:使用primefaces創建一個重定向鏈接到另一個頁面,春天
if (true condition) {
//redirect to page
} else {
//keep the current page
//open dialog
}
感謝。
試試這個
if(true condition) {
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect("www.google.pl");
}
if (condition is true) {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
externalContext.redirect("other-page.xhtml");
}
else {
RequestContext context = RequestContext.getCurrentInstance();
context.execute("myDialog.show();"); //assuming you have set the widgetVar on your dialog to "myDialog"
}
你使用Spring MVC控制器
? – kris14an
謝謝!不,我不知道 –