Re: Redirect before/during page load

Splash Forums PrettyFaces Users Redirect before/during page load Re: Redirect before/during page load


You are executing your method within RENDER_RESPONSE:

at javax.faces.component.UIComponent.encodeAll(
at com.sun.faces.application.ViewHandlerImpl.doRenderView(
at com.sun.faces.application.ViewHandlerImpl.renderView(

Therefore it is reasonable you get this exception as parts of the page are already rendered. You should do the redirect earlier. Like before RESTORE_VIEW. You could also do this from within a PrettyFaces page action which is executed exactly at this point in time.

Another option would be to use Rewrite as Lincoln mentioned. It’s very easy to implement something like this in Rewrite.