Foren

Redirection in the restore view phase

Roberfroid Vincent, geändert vor 9 Jahren.

Redirection in the restore view phase

New Member Beiträge: 10 Beitrittsdatum: 26.05.14 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Redirection in the restore view phase

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 8 Jahren.

RE: Redirection in the restore view phase

New Member Beiträge: 10 Beitrittsdatum: 26.05.14 Neueste Beiträge
OK. Thank you for your fast reply.
thumbnail
Neil Griffin, geändert vor 8 Jahren.

RE: Redirection in the restore view phase (Antwort)

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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