Message Boards

sendRedirect not working (JSF-2.2, Liferay7.2, primefaces-7.0)

Nimmy Gopinath, modified 3 Years ago.

sendRedirect not working (JSF-2.2, Liferay7.2, primefaces-7.0)

New Member Posts: 4 Join Date: 12/10/20 Recent Posts

Hi

We upgraded liferay from 6.2 to 7.2, JSF from 2.1 to 2.2 and primefaces from 5.1 to 7.0. When trying to redirect to a URL, getting below error

java.lang.IllegalStateException: Set render parameter has already been called
        at com.liferay.portlet.internal.ActionResponseImpl.sendRedirect(ActionResponseImpl.java:52)
        at javax.portlet.filter.ActionResponseWrapper.sendRedirect(ActionResponseWrapper.java:81)
        at com.liferay.faces.bridge.filter.internal.ActionResponseBridgeImpl.sendRedirect(ActionResponseBridgeImpl.java:54)
        at com.liferay.faces.bridge.context.internal.ExternalContextImpl.redirect(ExternalContextImpl.java:759)

Below given is the existing code snippet

ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
externalContext.redirect(url);

 

We have already tried the solution (Add the Bridge.DIRECT_LINK parameter to the URL with a value of "true":) mentioned in the below path but didn't work in our case.

https://issues.liferay.com/browse/FACES-1315?focusedCommentId=202366&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel 

Is there any fix or solution for this?

thanks,

Nimmy

Nimmy Gopinath, modified 3 Years ago.

RE: sendRedirect not working (JSF-2.2, Liferay7.2, primefaces-7.0)

New Member Posts: 4 Join Date: 12/10/20 Recent Posts

Hi,

Could someone please help as this issue is really blocking further development activities.

thanks,

Nimmy

thumbnail
Neil Griffin, modified 3 Years ago.

RE: sendRedirect not working (JSF-2.2, Liferay7.2, primefaces-7.0)

Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts

Hi Nimmy,

Please provide an SSCCE that reproduces the problem. Preferrably a Maven based project that I can build with "mvn clean package"

My main concern is the versions of Liferay Faces Dependencies that you are using. But I will be able to determine that from your SSCCE pom.xml descriptor.

Thanks,

Neil

Nimmy Gopinath, modified 3 Years ago.

RE: RE: sendRedirect not working (JSF-2.2, Liferay7.2, primefaces-7.0)

New Member Posts: 4 Join Date: 12/10/20 Recent Posts

Hi Neil,

While preparing the SCCE we narrowed down the cause to remoteCommand and that if it's removed everything is fine. Below given is the remoteCommand line that we used in our xhtml code.

<p:remoteCommand action="${abcBackingBean.initBeans}" autoRun="true" update=":f1 :scriptForm" onstart="spinnerOn('Building Application Menu', 'f1');"></p:remoteCommand>

Could you please help us to find the exact rootcause?

Thanks,

Nimmy