也许这是一个简单的问题,但我不知道答案。
我有一个项目,我的项目。在webContent中,我有home.xhtml、leave.html文件,还有另外两个文件夹:cats和dogs。在cats目录中,我有一个页面cat.xhtml,在目录dogs中,我还有一个页面dogs.xhtml。
I want to go from each page (home,cats, dogs) to page leave.html
In each file there is a commandLink
<h:form>
<h:outputLink value="leave.html" action="#{myBean.leave}">
<f:verbatim>Leave</f:verbatim>
</h:outputLink>
</h:form>
myBean
在方法leave
中返回字符串“leave”
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>leave</from-outcome>
<to-view-id>/leave.html</to-view-id>
</navigation-case>
</navigation-rule>
But this doesn t work.
I also tried using <to-view-id>../leave.html</to-view-id>
or add a new folder leave and put in there the leave.html page.
I used <to-view-id>/leave/leave.html</to-view-id>
or
<to-view-id>/../leave.html</to-view-id>
but all have the same result HTTP Status 404 /myProject/cats/leave.htlm type Status report
消息/myProject/cats/leave.htlm
description The requested resource ( /myProject/cats/leave.htlm) is not available.