Fórum

Redirection in the restore view phase

Roberfroid Vincent, modificado 9 Anos atrás.

Redirection in the restore view phase

New Member Postagens: 10 Data de Entrada: 26/05/14 Postagens Recentes
Hello,

We have a JSF 2.1 web application that performs a redirection in the beforePhase of a listener registered in the JSF restore view phase.

context.getExternalContext().redirect(newUrl);


We tried to deploy this web application on Liferay 6.2 and the last version of the bridge 3.2.x.
This causes however a NullPointerException in the method redirect of the BridgeContextImpl, at this line:

String currentFacesViewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();


This is due to the fact that the viewRoot has not been created yet in the beforePhase of the restore view phase.
We however use a direct link, so the variable currentFacesViewId is not needed. Is it forbidden to do a redirection at this stage?
Could it be possible to add a condition to avoid a NullPointerException?

Kind regards,
Vincent
thumbnail
Neil Griffin, modificado 9 Anos atrás.

RE: Redirection in the restore view phase

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Thank you for reporting this issue. Please click on the "Watch" link in JIRA for FACES-2216 in order to be notified about progress. We hope to have the issue fixed soon.
Roberfroid Vincent, modificado 9 Anos atrás.

RE: Redirection in the restore view phase

New Member Postagens: 10 Data de Entrada: 26/05/14 Postagens Recentes
OK. Thank you for your fast reply.
thumbnail
Neil Griffin, modificado 9 Anos atrás.

RE: Redirection in the restore view phase (Resposta)

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Hi Vincent,

The bug should be fixed now in our 3.2.x branch. When you get a chance, please test it in your environment and let us know if it is working for you.

Thank you,

Neil