phaselistener

Logging the invoked managed bean action in a PhaseListener

馋奶兔 提交于 2019-11-30 22:54:03
I am using Sun JSF 2.0 and wrote a phase listener extending javax.faces.event.PhaseListener . I am able to log source URI, target URI, total time and so on. But so far unable to log the ManagedBean and corresponding method that would be invoked during that client event. How can I do this? Input components send their client ID as request parameter name in case of synchronous requests and as request parameter value of javax.faces.source request parameter in case of asynchronous (ajax) requests. Just loop through the request parameters and check if an UICommand compnonent is resolveable by

How to @Inject in a PhaseListener

南笙酒味 提交于 2019-11-29 04:06:34
I have added a PhaseListener to faces-config.xml : <lifecycle> <phase-listener>com.project.NotificationListener</phase-listener> </lifecycle> The class seems to be otherwise correct as it is pretty simple. public class NotificationListener implements PhaseListener { @Inject private MyCDIStuff stuff; @Override public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } @Override public void beforePhase(PhaseEvent event) { this.stuff.doStuff(); } } The 'beforePhase' method gets called correctly, however the MyCDIStuff object is null. I tried using annotation @Singleton for the class which

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

白昼怎懂夜的黑 提交于 2019-11-27 18:33:16
How can I implement a PhaseListener which runs at end of the JSF lifecycle? You need to implement the PhaseListener interface and hook on beforePhase() of the PhaseId_RENDER_RESPONSE . The render response is the last phase of the JSF lifecycle. public class MyPhaseListener implements PhaseListener { @Override public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } @Override public void beforePhase(PhaseEvent event) { // Do your job here which should run right before the RENDER_RESPONSE. } @Override public void afterPhase(PhaseEvent event) { // Do your job here which should run right

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

流过昼夜 提交于 2019-11-26 19:29:37
问题 How can I implement a PhaseListener which runs at end of the JSF lifecycle? 回答1: You need to implement the PhaseListener interface and hook on beforePhase() of the PhaseId_RENDER_RESPONSE. The render response is the last phase of the JSF lifecycle. public class MyPhaseListener implements PhaseListener { @Override public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } @Override public void beforePhase(PhaseEvent event) { // Do your job here which should run right before the RENDER