문제

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?

도움이 되었습니까?

해결책

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.
        // ...
    }

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top