How do I create a simple redirect with jsf?
I tried:
<h:form>
<h:commandButton action="www.google.de" value="go to google" />
</h:form>
But when I click the button, I just stay on the index page. Nothing happens!
What is wrong here?
Is JSF absolutely necessary here? You don’t seem to need to submit anything to your side at all. Just use plain HTML.
Please note that the URL to the external site must include the scheme (the
http://part), otherwise it would just be submitted relative to the current request URI, such ashttp://example.com/context/www.google.de.If you really need to submit to your side, e.g. to preprocess and/or log something, then you could use
ExternalContext#redirect()in the action method.with