[英]How to activate phaselistener when HTML5 file is called in JSF
我在JSF项目中定义了一个PhaseListener
。 在浏览器中调用*.xhtml
文件时它正在工作。 但是在浏览器中调用*.html5
文件时它无效。 我可以做phaseListener
吗?
如果我不能检查,我可以做什么而不是phaseListener
?
请改用servlet过滤器 。
这是一个基本的启动示例:
@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 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.