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>
<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>
解决方案 »
- 后台管理网站,提交很多项,每一项又有很多数据,怎么能够确保数据的完整性呢
- 求助:NETBEANS中自带的TOMCAT,无法独自运行,求高人指点!
- 求中国地区的三级联动下拉菜单,带数据库文件的,感激不尽!!!
- 关于session的问题
- 请教!
- 未发现数据源名称并且未指定默认驱动程序问题
- 请问在jb里写好的程序如何在tomcat环境下运行呢?
- 写最大公约数时候的一点小问题
- 我有这些工具,但要如何使用呢
- 请问WEB服务器(比如Tomcat等)如何使JSP正确处理中文和显示中文,请各位师傅指教,请给出具体的解决方案!急~~~
- 使用DOM4J解析XML出现空格变成问号
- struts2 result 问题
http://localhost:8080/statLogin.do?method=loginOutManage
http://localhost:8080/statLogin.do?method=login
我要拦截这两个怎么做
<?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>