If you're in a JSF app you probably want to use the PhaseListener approach as you'll be able to get more information, otherwise a ServletFilter or ServletRequestListener would work.
I like PhaseListener approach. It'll work only for xhtml views but that's fine.
I want to do persistence of user info async. Will that be a problem calling a stateless EJB from a phase listener?
What is a good way of adding my phase listener in Seam? Is it a matter of adding it to faces-config and put my logic for restore view phase? Is that a good phase for logging info?
Last question, what extra information does a phase listener give me over a servlet filter?
1 of 1 people found this helpful
Yeah, that sounds like a sound way of doing it. There shouldn't be a problem calling a SLSB from a phase listener. From the a PhaseListener you'll be able to get the FacesContext and anything within it, current state may be important to you, maybe not.