I want to implement a situation where the user enter a URL, and if a specified condition is true in my managed bean this URL will be opened in a new web page.
I found this possibility:
The “h:link” tag is useful to generate a link which requires to interact with the
JSF
“outcome” , but lack of “action” support make it hard to generate a dynamic outcome.The “h:commandLink” tag is suck, the generated
JavaScript
is really scary! Not recommend to use this tag, unless you have a solid reason to support. But it supports the “action” attribute, which is what “h:link” lack of.The “h:outputLink” is useful to generate a link which does not require to interact with the
JSF
program itself. At last, it will be perfect if the “action” attribute is added into the “h:link“.
But I didn't find a way to launch the open web page from my managed bean after the condition is verified.
I'm using JSF2.0, Facelets and PrimeFaces 3.4.