spring-mvc的拦截器,是按你的后缀来的,
    <servlet-mapping>   
        <servlet-name>springServlet</servlet-name>     
        <url-pattern>*.html</url-pattern>
    </servlet-mapping> 
你是,。html,就只拦截.html的,
配置文件 <mvc:interceptors>
   
          <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
 </bean>
      
   <mvc:interceptor>
          <mvc:mapping path="/**"/>
          <bean id="ajaxInterceptor" class="xxx.AjaxInterceptor" />
       </mvc:interceptor>
</mvc:interceptors>

解决方案 »

  1.   

    兄弟们谢谢  可不可以只拦截 几个特定得请求  例如
    http://localhost:8080/statLogin.do?method=loginOutManage
    http://localhost:8080/statLogin.do?method=login
    我要拦截这两个怎么做 
      

  2.   

    <mvc 标签怎么来得啊  导入那个才可以点出来啊
      

  3.   

    加入头文件
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" 
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p" 
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-3.0.xsd
            http://www.springframework.org/schema/aop 
            http://www.springframework.org/schema/aop/spring-aop-3.0.xsd>
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
       
    指定路径
    <mvc:interceptor>
      <mvc:mapping path="http://localhost:8080/statLogin.do?method=loginOutManage"/>
      <bean id="xxx" class="xxx.xxx" />
      </mvc:interceptor>