The closest thing you can achieve to achieve exactly the same hooks
<f:view beforePhase="#{bean.beforePhase}" afterPhase="#{bean.afterPhase}">
with
public void beforePhase(PhaseEvent event) { if (event.getPhaseId == PhaseId. RENDER_RESPONSE) {
preRender can be made simpler, place it anywhere:
<f:event type="preRenderView" listener="#{bean.preRenderView}" />
with
public void preRenderView(ComponentSystemEvent event) {
(the argument is optional, it can be omitted if it is not used)
There is no such thing as postRenderView , but you can easily create custom events. For instance.
@NamedEvent(shortName="postRenderView") public class PostRenderViewEvent extends ComponentSystemEvent { public PostRenderViewEvent(UIComponent component) { super(component); } }
and
public class PostRenderViewListener implements PhaseListener { @Override public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } @Override public void beforePhase(PhaseEvent event) {
which you register in faces-config.xml as
<lifecycle> <phase-listener>com.example.PostRenderViewListener</phase-listener> </lifecycle>
then you can finally use
<f:event type="postRenderView" listener="#{bean.postRenderView}" />
with
public void postRenderView(ComponentSystemEvent event) {
source share