web.xml中 listener,filter,servlet需按顺序。
<listener>
<listener-class>listener.VisitCountListener</listener-class>
</listener>
<filter>
<filter-name>LoginCheckFilter</filter-name>
<filter-class>filter.LoginCheckFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginCheckFilter</filter-name>
<url-pattern>/secure/*</url-pattern>
</filter-mapping>