Springmvc拦截器的配置
<mvc:interceptor>
<!--<mvc:mapping path="/user/search"/>-->
<!--<mvc:mapping path="/user/updatePwd"/>-->
<!--<mvc:mapping path="/user/updateHeaderPic"/>-->
<mvc:mapping path="/user/**"></mvc:mapping>
<mvc:exclude-mapping path="/user/updatePwd"></mvc:exclude-mapping>
<mvc:exclude-mapping path="/user/updatebgd/*"></mvc:exclude-mapping>
<bean class="com.dodoke.core.LoginInterceptor"></bean>
</mvc:interceptor>
springmvc的核心servlet
第一种:[servlet-name]-servlet.xml ,比如:springmvc-servlet.xml
第二种是:改变命名空间 namespace
必须配置文件在放入在web-inf目录下。
第三种是通过:contextConfigLocation
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>namespace</param-name>
<param-value>dodokemvc</param-value>
</init-param>
</servlet>
映射物理路径
<property name="prefix" value="/WEB-INF/pages/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
jar包
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<spring-version>4.3.14.RELEASE</spring-version>
</properties>