How to implement a PhaseListener which runs at end of lifecycle?

前端 未结 2 1928
渐次进展
渐次进展 2020-12-04 22:31

How can I implement a PhaseListener which runs at end of the JSF lifecycle?

2条回答
  •  春和景丽
    2020-12-04 23:03

    In jsf 2 you can use to hook MyPhaseListener for some facelet. MyPhaseListener should implement PhaseListener and override

    • afterPhase - with code to be run after end of phase
    • beforePhase - with code to be run before phase started
    • getPhaseId - PhaseId enum specifying name of phase for which the listener to be invoked (PhaseId.RENDER_RESPONSE as last phase of lifecycle)

提交回复
热议问题