2015-01-09 54 views

回答

0

試試這個

if(true condition) { 
    HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); 
    response.sendRedirect("www.google.pl"); 
} 
0
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控制器
相關問題