Question

I define a PhaseListener in JSF project. It is working when *.xhtml file is called in browser. But It is not working when *.html5 file is called in browser. Can do I do phaseListener for?

If I can not this check, What can I do instead of phaseListener?

Était-ce utile?

La solution

Use a servlet filter instead.

Here's a basic kickoff example:

@WebFilter("*.html5")
public class MyFilter implements Filter {

    @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        // Perform here some code before processing the request.
        // ...

        chain.doFilter(req, res);

        // Perform here some code after processing the request.
        // ...
    }

}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top