Do I remember right or the parameter immediate set to true should change the url of the browser?
If it is correct, why doesn’t this link works properly?
<h:form>
<h:commandLink immediate="true" action="/url_page.xhtml" value="Label link"/>
</h:form>
After some research I found a question where the author added the string “?faces-redirect=true” to the url… Is it work like I would? Should I set something else?
Thank you for your help.
P.S.: I tried also h:link but, perhaps, it doesn’t execute all thing because after that the next page returns a nullpointerException but the url change as I want…
Solution complete: I change the action of my h:commandLink to call a method that returns /url_page?faces-redirect=true because I found that nullpointer exception was into a servlet-filter…
Thank you @BalusC and @Matt !
No this attribute has a different purpose.
You can use
h:linkfor navigation.h:commandLinkneeds a bean method asactionattribute. The outcome of the action method is the navigation target. If the action method returnsnullor is avoidmethod, the current page will be reloaded. If it returns a String, JSF will take it and navigate to that outcome.If you want to perform a redirection from your action method, you can add
?faces-redirect=trueto your outcome, e.g.