SpringMVC拦截器不拦截Tomcat虚拟路径

<mvc:interceptors>
        <bean class="Interceptor.UserInterceptor"/>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <mvc:exclude-mapping path="/hello1"/>
            <bean class="Interceptor.MyInterceptor"/>
        </mvc:interceptor>
    </mvc:interceptors>

为什么不会拦截 http://localhost:8080/,按道理来说index.jsp页面不应该会被拦截吗

阅读 2k
1 个回答

我猜是你前面套的 WebServer 配置了 default 之类的参数,根目录这种的直接被 WebServer 处理掉了,不会进到你的程序里。

你可以搜索“SpringMVC+拦截器+根目录”得到你想要的结果。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题