Page navigation with JSF -
hy, simple question, don't know answer.
i have project, myproject. in webcontent have file home.xhtml, leave.html , have 2 other folders cats , dogs. in cats directoy have page cat.xhtml, , in director dogs have page dogs.xhtml.
i want go each page (home,cats, dogs) page leave.html have in each file commandlink
`<h:form> <h:outputlink value="leave.html" action="#{mybean.leave}"> <f:verbatim>leave</f:verbatim> </h:outputlink> </h:form>`
mybean in method leave returns string "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 doesn't work. tried using <to-view-id>../leave.html</to-view-id>
or add new folder leave , put in there leave.html page used <to-view-id>/leave/leave.html</to-view-id>
oe <to-view-id>/../leave.html</to-view-id>
but have same result http status 404 /myproject/cats/leave.htlm type status report
message /myproject/cats/leave.htlm
description requested resource ( /myproject/cats/leave.htlm) not available.
thank in advance answers
your navigation not working because page going "leave.html". h:outpulink uses value property navigation. suggest use h:commandlink , use value property display link (leave) , action property from-outcome string.
<h:commandlink value="leave" action="#{mybean.leave}">
Comments
Post a Comment