I have a JSF web application using SPRING3 + JSF2 (mojarra 2.1.12) and I have the following problem: I want to redirect my web page and I want to pass a parameter.
First, I used a button and it worked properly but then I decided to change it to a commandlink. The same code doesn't work and I don't know why.
The first button code was as follows:
<sec:authorize ifAnyGranted="ROLE_USER">
<p:button id="miCuenta" value="miCuenta" title="miCuenta" outcome="/views/usuarios/visorUsuario">
<f:param name="itemId" value="#{userContext.user.pk}" />
</p:button>
</sec:authorize>
And I changed it to this:
<sec:authorize ifAnyGranted="ROLE_USER">
<h:commandLink id="miCuenta" value="miCuenta" action="/views/usuarios/Usuarios?faces-redirect=true">
<f:param name="itemId" value="#{userContext.user.pk}" />
</h:commandLink>
</sec:authorize>
I don't know what the problem is in the second approach. Anyone?
Thanks!!