Using navigationhandler with external url
Is it possible to use navigationhandler with external urls?
Depending on the current business logic some links shall refer to external
resources, but advantages of the navigationhandler should remain. (In
combination with url-rewriting using pretty-faces.
Basically I want to use the link or components h:link with external urls.
The h:outputLink supports external urls, but if an external url is used
the url-rewriting does not works anymore.
Url-Rewriting:
/subsites/site.xhtml --> /subsites/foo
jsf:
// default
<h:link value="link" outcome="/subsites/site.xhtml">
<f:param name="foo" value="#{bean.foo}" >
</h:link>
// external-url
<h:link value="link" outcome="www.bar.com/subsites/site.xhtml">
<f:param name="foo" value="#{bean.foo}" >
</h:link>
html href: (with url-rewriting):
// default
'/subsites/foo'
// external-url
'www.bar.com/subsites/foo'
Besides using a navigationhandler there are a few workarounds possible:
New link component, that simulates default behavior and prefixes the
domain to the final html output could solve this. The base domain could be
added via attribute or programatically extracted.
Manually invoke navigationhandler to get the final internal uri and append
it to the target base domain. No good solution since parameter and
converters must be built within managed bean.
No comments:
Post a Comment