Web过滤器组件演示文件修改版.pptVIP

  • 1
  • 0
  • 约1.91千字
  • 约 10页
  • 2017-02-07 发布于江苏
  • 举报
Web过滤器组件演示文件修改版

Web过滤器组件 本章目标 描述过滤器 理解过滤器生命周期 实现简单的过滤器 Web过滤器 Filter接口 过滤器的生命周期 过滤器链 FilterChain 接口用于调用过滤器链中的一系列过滤器 由Web容器根据Filter映射自动产生FilterChain对象 FilterChain.doFilter(ServletRequest, ServletResponse)方法用于调用过滤器链中的下一个过滤器 在过滤器链中的最后一个过滤器中调用doFilter方法将请求发送的指定的Web资源 开发过滤器 public class EnCodingFilter implements Filter { private String charset = “UTF-8; public void init(FilterConfig config) throws ServletException { if (config.getInitParameter(charset) != null) { this.charset = config.getInitParameter(charset); } } public void doFilter(ServletRequest request, ServletResponse response,

文档评论(0)

1亿VIP精品文档

相关文档