I have following code for initializing bean values depending upon url parameter.
<f:metadata>
<f:viewParam name="id" value="#{inningBean.inningId}" />
<f:event type="preRenderView"
listener="#{inningBean.initInningBeanForBallByBallScoring}" />
</f:metadata>
This is working fine. But I want that in certain conditions(some validation forexample), the user is redirected to another page from listener method.
How can I do that?
Use
ExternalContext#redirect().