Combination View Flat View Tree View
Threads [ Previous | Next ]
Muhammad Taha
Unable to redirect to a non-Faces view during the RENDER_PHASE.
January 18, 2013 6:12 AM
Answer

Muhammad Taha

Rank: Junior Member

Posts: 66

Join Date: May 1, 2012

Recent Posts

Hi,
On submit of <h:commandButton> Im calling a method in controllerBean inside im redirecting to another portal page for that im using externalContext.redirect("http://localhost:8080/web/quest/target");
<h:commandButton action="loginControllerBean.myMethod"/>
On page load it self im getting following error.

Caused by: java.lang.IllegalStateException: 6.1.3.1: Unable to redirect to a non-Faces view during the RENDER_PHASE.
at com.liferay.faces.bridge.context.BridgeContextImpl.redirect(BridgeContextImpl.java:497) [liferay-faces-bridge-impl-3.1.0-ga1.jar:3.1.0-ga1 (Galatia / Aug 21, 2012 AD)]
at com.liferay.faces.bridge.context.ExternalContextImpl.redirect(ExternalContextImpl.java:149) [liferay-faces-bridge-impl-3.1.0-ga1.jar:3.1.0-ga1 (Galatia / Aug 21, 2012 AD)]
at com.xerox.ghs.he.provider.bean.LoginControllerBean.sub(LoginControllerBean.java:54)
Neil Griffin
RE: Unable to redirect to a non-Faces view during the RENDER_PHASE.
January 18, 2013 8:26 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

I'm a little surprised by the error message. When a user clicks on the h:commandButton (non-Ajax), a full-page postback should occur, and loginControllerBean.myMethod should get called during the ACTION_PHASE of the portlet lifecycle (not the RENDER_PHASE). Perhaps you could provide more details as to your specific use-case for h:commandButton?
Muhammad Taha
RE: Unable to redirect to a non-Faces view during the RENDER_PHASE.
January 18, 2013 10:42 AM
Answer

Muhammad Taha

Rank: Junior Member

Posts: 66

Join Date: May 1, 2012

Recent Posts

Neil..It was some javascript problem.. Now its working. Thanks.
Neil Griffin
RE: Unable to redirect to a non-Faces view during the RENDER_PHASE.
January 18, 2013 11:50 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

OK thanks for the update. I'm happy to hear that it is working for you now. emoticon