JSF Navigation Rules with Relative Paths

2019-08-25 11:52发布

Say I am on a page at

www.foo.com/foo/bar/page.jsf

and want to define a navigation rule to go to

www.foo.com/foo/

how would I define the <to-view-id> of the navigation rule. I thought it would be something like this:

<navigation-case>
  <from-outcome>goToFoo</from-outcome>
  <to-view-id>/../</to-view-id>
</navigation-case>

but that throws a parser error when called. I figure I am missing something. Any ideas?

1条回答
甜甜的少女心
2楼-- · 2019-08-25 12:44

JSF navigation rules are relative to the application context, not relative to the current page. If foo is your app context, then /page.jsp will always go to www.foo.com/foo/page.jsf, not www.foo.com/foo/bar/page.jsf.

Also, I believe you must refer to actual pages e.g. you must include the page.jsf portion.

查看更多
登录 后发表回答