【发布时间】:2013-07-13 16:13:02
【问题描述】:
我正在尝试使用命令按钮在我的托管 bean 中转发一个页面:
<h:commandButton action="#{bean.action}" value="Go to another page" />
下面一行:
public void action() throws IOException {
FacesContext.getCurrentInstance().getExternalContext().redirect("another.xhtml");
}
重定向页面,而不是转发。我已经看到了与此类似的问题并尝试了给定的解决方案:
public void action() throws IOException {
FacesContext.getCurrentInstance().getExternalContext().dispatch("another.xhtml");
}
但我收到以下错误:
Index: 0, Size: 0
那么如何从托管 bean 转发到页面?
【问题讨论】:
-
你能发布异常堆栈跟踪吗?
-
@erencan 我想我解决了,谢谢
标签: jsf redirect navigation forward