/*
* servlet监听器开发步骤:
* 1.写一个类实现XXXListener接口(6个=3个容器+3个对容器中属性进行操作)
* 2.在web.xml中配置<listener> ---规范:一般写在<Filter>和<Servlet>之间
*
*/
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name></display-name>
<filter>/*这里是设置过滤器的*/
<filter-name>count</filter-name>
<filter-class>cn.hncu.filter.CountFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>count</filter-name>
<url-pattern>/*</url-pattern>/*这里是挡住所有---jsp页面servlet,service*/
</filter-mapping>
/*这里如果是要特意挡servlet层那么下面就不能写成url-pattern,要写成<servlet-name> </servlet-name> 挡住什么是这样设置的‘/.../..’例如/servlet/loginservlet*/
<listener>
<listener-class>cn.hncu.listener.MyContextListener</listener-class>
</listener>
<listener>
<listener-class>cn.hncu.listener.MyContextAttributeListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>