Spring MVC配置文件解释
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
default-lazy-init="true">
<context:property-placeholder location="classpath*:/shopxx.properties" ignore-resource-not-found="true" ignore-unresolvable="true" />
<!--加载controller-->
<context:component-scan base-package="net.shopxx" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!--加载声明式数据验证-->
<mvc:annotation-driven validator="validator" />
<!--加载拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/order/**" />
<mvc:mapping path="/member/**" />
<bean id="memberInterceptor" class="net.shopxx.interceptor.MemberInterceptor" />
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/**" />
<mvc:exclude-mapping path="/payment/**" />
<bean id="tokenInterceptor" class="net.shopxx.interceptor.TokenInterceptor" />
</mvc:interceptor>
<!--
<mvc:interceptor>
<mvc:mapping path="/admin/**" />
<bean id="executeTimeInterceptor" class="net.shopxx.interceptor.ExecuteTimeInterceptor" />
</mvc:interceptor>
-->
<mvc:interceptor>
<mvc:mapping path="/admin/**" />
<bean id="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor">
<property name="cacheSeconds" value="0" />
</bean>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean id="openSessionInViewInterceptor" class="org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/admin/**" />
<bean id="listInterceptor" class="net.shopxx.interceptor.ListInterceptor" />
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/admin/**" />
<bean id="logInterceptor" class="net.shopxx.interceptor.LogInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource" />
</bean>
<!-- 对转向页面的路径解析。prefix:前缀, suffix:后缀 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="contentType" value="text/html; charset=UTF-8" />
<property name="suffix" value="${template.suffix}" />
</bean>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="utf-8" />
</bean>
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="defaultErrorView" value="shop/common/error" />
</bean>
</beans>
Spring MVC配置文件解释的更多相关文章
- Spring MVC 配置文件dispatcher-servlet.xml 文件详解
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- Spring MVC 配置文件dispatcher-servlet.xml 文件详解(转自 学无止境-yj)
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- Spring MVC配置文件的三个常用配置详解
转自:http://www.cnblogs.com/benwu/articles/5162614.html Spring MVC项目中通常会有二个配置文件,sprng-servlet.xml和appl ...
- spring mvc 配置文件拦截器过滤url
最近在用spring mvc拦截器,sprin 版本号4.0.6.RELEASE, <mvc:interceptor> <mvc:mapping path="/admin/ ...
- spring配置文件和spring mvc配置文件的区别
Question: Are applicationContext.xml and spring-servlet.xml related anyhow in Spring Framework? Will ...
- spring mvc 配置文件信息记录
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
- Spring MVC配置文件
都说开发Spring Web程序的配置文件很繁琐,所以就写了一篇配置博客, 首先是pom.xml文件 <project xmlns="http://maven.apache.org/P ...
- spring mvc配置文件dispatcher-servlet.xml详解
Spring的配置文档<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="ht ...
- Spring MVC 配置文件
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...
随机推荐
- Java并发编程:并发容器之CopyOnWriteArrayList
转载: Java并发编程:并发容器之CopyOnWriteArrayList Copy-On-Write简称COW,是一种用于程序设计中的优化策略.其基本思路是,从一开始大家都在共享同一个内容,当某个 ...
- hibernate的懒加载问题
产生原因: 当使用hibernate查询一个对象的时候,如果Session关闭,再调用该对象关联的集合或者对象的时候,会产生懒加载异常! 解决方案: 方案一: 在Session关闭之前,查询对象关联的 ...
- 11 个用来创建图形和图表的 JavaScript 工具包
11个用来创建图形和图表的JavaScript工具包,方便开发者使用,喜欢的各位收藏一下吧! Aristochart DEMO|| Download Aristochart 是一个用来创建图形和图表的 ...
- [redis] Redis 常用命令
redis命令文档:http://doc.redisfans.com/index.html 1. redis查看当前所有的key KEYS * 模糊匹配keykeys 模糊字符串* 2. 查看当前 ...
- Struts、JSTL标签库的基本使用方法
一 使用Struts标签之前需要经过下面3个步骤的配置. 1.导入TLD文件. 2.在web.xml中注册标签库. 3.在页面中引入标签库. 下面详细介绍以上步骤. 1 导入TLD文件. TLD文件是 ...
- Storm(1) - Setting Up Development Environment
Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...
- [转]CentOS更改yum源与更新系统
[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cent ...
- redhat enterprixe 5.0 下DHCP服务器rpm安装配置及其测试
一.了解DHCP DHCP服务提供动态指定IP地址和配置参数的机制.有动态和静态两种方式. 二.rpm安装 因为配过Samba,所以感觉挺简单. 首先找到主程序和几个附属程序的rpm的安装包.应该都是 ...
- ios 定位获取当前位置信息
啊,倦怠的人生啊~~ 什么事情都没做一眨眼就2点半了啊!!赶紧爬起来写博客啊. 诸位看官会鄙视我么,表示我真心不是把这当技术文章写的啊. 啊,下午我们来第二篇.获取地理位置信息.嗯嗯,秘籍上说叫逆向地 ...
- API 进程、线程函数
CancelWaitableTimer 这个函数用于取消一个可以等待下去的计时器操作 CallNamedPipe 这个函数由一个希望通过管道通信的一个客户进程调用 ConnectNamedPipe 指 ...