springmvc的拦截器,怎么设置不拦截的url
5个回答
展开全部
<mvc:interceptors>
<bean id="allInterceptor" class="com.base.interceptor.AllInterceptor"/>
<mvc:interceptor>
<mvc:mapping path="/*/**" />
<bean id="CommonInterceptor" class="com.base.interceptor.CommonInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/dical/**"/> //拦截的url
<mvc:mapping path="/admin/**"/>//拦截的url
<mvc:exclude-mapping path="/admin/login"/> //不拦截的url
<mvc:exclude-mapping path="/admin/main"/>//不拦截的url
<bean id="DicalInterceptor" class="com.base.interceptor.DicalInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
相关C语言知识:http://edu.51cto.com/course/courseList/id-12.html
<bean id="allInterceptor" class="com.base.interceptor.AllInterceptor"/>
<mvc:interceptor>
<mvc:mapping path="/*/**" />
<bean id="CommonInterceptor" class="com.base.interceptor.CommonInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/dical/**"/> //拦截的url
<mvc:mapping path="/admin/**"/>//拦截的url
<mvc:exclude-mapping path="/admin/login"/> //不拦截的url
<mvc:exclude-mapping path="/admin/main"/>//不拦截的url
<bean id="DicalInterceptor" class="com.base.interceptor.DicalInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
相关C语言知识:http://edu.51cto.com/course/courseList/id-12.html
2015-04-12 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517189
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
<!-- 默认首页 -->
<mvc:view-controller path="/" view-name="redirect:/loginpage" />
<!-- 拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/loginpage/**"/>
<bean class="com.me.common.LoginInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
<mvc:exclude-mapping path="/loginpage/**"/>
------------------改成----->
<mvc:exclude-mapping path="/"/>
<mvc:exclude-mapping path="/loginpage/**"/>
估计是你访问"/"时就到了拦截器
<mvc:view-controller path="/" view-name="redirect:/loginpage" />
<!-- 拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/loginpage/**"/>
<bean class="com.me.common.LoginInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
<mvc:exclude-mapping path="/loginpage/**"/>
------------------改成----->
<mvc:exclude-mapping path="/"/>
<mvc:exclude-mapping path="/loginpage/**"/>
估计是你访问"/"时就到了拦截器
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<mvc:interceptors>
<bean id="allInterceptor" class="com.base.interceptor.AllInterceptor"/>
<mvc:interceptor>
<mvc:mapping path="/*/**" />
<bean id="CommonInterceptor" class="com.base.interceptor.CommonInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/dical/**"/> //拦截的url
<mvc:mapping path="/admin/**"/>//拦截的url
<mvc:exclude-mapping path="/admin/login"/> //不拦截的url
<mvc:exclude-mapping path="/admin/main"/>//不拦截的url
<bean id="DicalInterceptor" class="com.base.interceptor.DicalInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
<bean id="allInterceptor" class="com.base.interceptor.AllInterceptor"/>
<mvc:interceptor>
<mvc:mapping path="/*/**" />
<bean id="CommonInterceptor" class="com.base.interceptor.CommonInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/dical/**"/> //拦截的url
<mvc:mapping path="/admin/**"/>//拦截的url
<mvc:exclude-mapping path="/admin/login"/> //不拦截的url
<mvc:exclude-mapping path="/admin/main"/>//不拦截的url
<bean id="DicalInterceptor" class="com.base.interceptor.DicalInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<!-- 默认首页 -->
<mvc:view-controller path="/" view-name="redirect:/loginpage" />
<!-- 拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/loginpage/**"/>
<bean class="com.me.common.LoginInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
<mvc:exclude-mapping path="/loginpage/**"/>
------------------改成----->
<mvc:exclude-mapping path="/"/>
<mvc:exclude-mapping path="/loginpage/**"/>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询