qq_21368815 2017-10-24 05:06 采纳率: 0%
浏览 1131

求助,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条回答 默认 最新

  • devmiao 2017-10-24 05:49
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 centos7系统下abinit安装时make出错
  • ¥15 hbuildex运行微信小程序报错
  • ¥50 HAL ADCDMA单次触发转换
  • ¥15 关于#python#的问题:我知道这个问题对你们来说肯定so easy
  • ¥15 wpf datagrid如何实现多层表头
  • ¥15 为啥画版图在Run DRC会出现Connect Error?可我Calibre的hostname和计算机的hostname已经设置成一样的了。
  • ¥20 网站后台使用极速模式非常的卡
  • ¥20 Keil uVision5创建project没反应
  • ¥15 mmseqs内存报错
  • ¥15 vika文档如何与obsidian同步