Filter的代码实现方法是什么?

Filter的代码实现方法:
马 克-to-win:要想实现Filter,条件1)你的Filter类必须实现javax.servlet包中的Filter接口。条件2)你还需在 web.xml中加一段类似下面这样的话,其中url-pattern指定了你的Filter要作用的目标,其中下例中的/*代表根目录下的所有东西,包 括html,jsp,servlet等。

  <filter>
        <filter-name>kkk</filter-name>
       <filter-class>你的Filter类</filter-class>
    </filter>
  <filter-mapping>
      <filter-name>kkk</filter-name>

课程详情:http://www.mark-to-win.com/index.html?content=Jsp/jspUrl.html&chapter=Jsp/jsp6_web.html#FilterImplementation

猜你喜欢

转载自blog.csdn.net/mark_to_win/article/details/84953722