求助,springmvc拦截器问题

<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<mvc:annotation-driven/>
<mvc:default-servlet-handler/>

<context:component-scan base-package="com.ok.controller" />
<context:component-scan base-package="com.app.controller" /><!--
<context:component-scan base-package="com.json" />-->

<!-- 对静态资源文件的访问  restful-->
<mvc:resources mapping="/admin/**" location="/,/admin/" />
<mvc:resources mapping="/static/**" location="/,/static/" />
<mvc:resources mapping="/plugins/**" location="/,/plugins/" />
<mvc:resources mapping="/uploadFiles/**" location="/,/uploadFiles/" />

<!-- 访问拦截  -->
<mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/**/**"/>
        <mvc:exclude-mapping path="/web/user/Register" />
        <mvc:exclude-mapping path="/web/user/hasU"/>
        <mvc:exclude-mapping path="/web/user/sendSmsVerifyCode"/>
        <mvc:exclude-mapping path="/web/user/saveUser"/>
        <bean class="com.ok.interceptor.LoginHandlerInterceptor"/>
    </mvc:interceptor>

    <mvc:interceptor>
        <mvc:mapping path="/appusers/**"/>
        <mvc:exclude-mapping path="/appusers/login"/>
        <mvc:exclude-mapping path="/appusers/register"/>
        <mvc:exclude-mapping path="/appusers/forgetPassReset"/>
        <bean class="com.app.interceptor.CheckUserInterceptor"/>
    </mvc:interceptor>
</mvc:interceptors>

<!-- 配置SpringMVC的视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
</bean>

<bean id="exceptionResolver" class="com.fh.resolver.MyExceptionResolver"></bean>

<!-- 上传拦截,如最大上传值及最小上传值 -->
<bean id="multipartResolver"   class="org.springframework.web.multipart.commons.CommonsMultipartResolver" >
    <property name="maxUploadSize">
        <value>104857600</value>
    </property>
    <property name="maxInMemorySize">
        <value>4096</value>
    </property>
    <property name="defaultEncoding">
        <value>utf-8</value>
    </property>
</bean>

配置如上,我想访问login路径,但一直被拦截。。请问怎么解决,

3个回答

qq_21368815
qq_21368815 不行啊,,情况也不一样。。
2 年多之前 回复
  <mvc:interceptor>
        <mvc:mapping path="/**/**"/>
        <mvc:exclude-mapping path="/web/user/Register" />
        <mvc:exclude-mapping path="/web/user/hasU"/>
        <mvc:exclude-mapping path="/web/user/sendSmsVerifyCode"/>
        <mvc:exclude-mapping path="/web/user/saveUser"/>
        <bean class="com.ok.interceptor.LoginHandlerInterceptor"/>
    </mvc:interceptor> 

中加上

 <mvc:exclude-mapping path="/appusers/login"/>
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问