【发布时间】:2011-11-15 19:47:47
【问题描述】:
我正在使用 Glassfish 3.1.1 和 JSF 2.0:
我有以下代码:
public String doLoginOrCC() {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
this.flightNumber = request.getParameter("flightNumber");
if (request.getRemoteUser() == null) {
return "login.xhtml";
} else {
return "https://" + request.getLocalAddr() + ":8181" + request.getContextPath() + "/bookSeat.xhtml";
}
}
如果用户未登录,则转到 login.xhtml。
如果用户已登录,则转到https://localhost:8181/APP/bookSeat.xhtml
Unable to find matching navigation case with from-view-id '/flightInfo.xhtml' for action '#{bookSeatController.doLoginOrCC}' with outcome 'https://127.0.0.1:8181/PlaneTicketProgram5-war/bookSeat.xhtml'
是否必须在 faces-config.xml 文件中添加导航规则。
如果是这样,我将如何编写导航规则?
【问题讨论】:
标签: jsf jsf-2 glassfish-3