0

Am running all my Phase Listeners in RENDER_RESPONSE phase.

I came across this post which talks about using RESTORE_VIEW phase for Application level access control. So, this gives me a thought that Phase Listeners might have to be run on different PhaseId based on the requirement.

Answer here from BalusC, gives a good picture on choosing the right bean scopes.

Similarly, is there an explanation for choosing the right PhaseId?

Community
  • 1
  • 1
Vikas V
  • 3,176
  • 2
  • 37
  • 60
  • What do you mean with "applications"? – BalusC Jan 04 '13 at 12:22
  • By "applications" I mean all my JSF implementations (To be specific its JSF1.2) I have edited my question accordingly – Vikas V Jan 04 '13 at 12:25
  • How exactly are you running them in render response phase? This statement doesn't make sense. – BalusC Jan 04 '13 at 12:26
  • I have this piece of code in my `CustomPhaseListener`. `public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; }` I think, I should have better used the term _listening_ instead of _running_ – Vikas V Jan 04 '13 at 12:28
  • So? That just invokes the `beforePhase()` and `afterPhase()` methods of the same phase listener instance during render response phase. How exactly are you running a "JSF application" or "JSF implementation" through it? – BalusC Jan 04 '13 at 12:31
  • I was still adding this statement, "I think, I should have better used the term _listening_ instead of _running_". Before posting this, I mistakenly pressed Enter button. How to decide at which `Phase` should my JSF implementation should invoke `beforePhase()` and `afterPhase()` ? – Vikas V Jan 04 '13 at 12:37
  • Perhaps you actually meant to say "all my phase listeners" instead of "all my JSF implementations"? – BalusC Jan 04 '13 at 12:38
  • Exactly. I meant to say "all my Phase Listeners" :) – Vikas V Jan 04 '13 at 12:43

0 Answers0