日期:2014-05-17  浏览次数:20703 次

web filter过滤器不起作用,帮忙看看
我做了一个简单的web demo,写了个过滤器,但就是不生效,tomcat6,启动的时候都不进断点,不知道是不是自己配置错了,大家帮分析一下。启动也不报错

---------web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  
    <filter>       
        <filter-name>aa</filter-name>       
        <filter-class>cn.util.AutoSetUserAdapterFilter</filter-class>   
    </filter> 
<filter-mapping> 
        <filter-name>aa</filter-name> 
        <url-pattern>/*</url-pattern> 
    </filter-mapping>


<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>


-----AutoSetUserAdapterFilter
package cn.util;  
  
import java.io.IOException;  
import javax.servlet.Filter;  
import javax.servlet.FilterChain;  
import javax.servlet.FilterConfig;  
import javax.servlet.ServletException;  
import javax.servlet.ServletRequest;  
import javax.servlet.ServletResponse;  
import javax.servlet.http.HttpServletRequest;  
import org.jasig.cas.client.validation.Assertion;  

  
/** 
 * CAS单点登陆的过滤器功能类,该类用来自动生成子应用的登陆Session 
 *  
 */  
public class AutoSetUserAdapterFilter  implements Filter {  
      
    /** 
     * Default constructor.  
     */  
    public AutoSetUserAdapterFilter() {  
    }  
  
    /** 
     * @see Filter#destroy() 
     */  
    public void destroy() {  
    }  
  
   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,  
                   ServletException {  
           HttpServletRequest httpRequest = (HttpServletRequest) request;  
&n