<?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配置文件解释的更多相关文章

  1. Spring MVC 配置文件dispatcher-servlet.xml 文件详解

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  2. Spring MVC 配置文件dispatcher-servlet.xml 文件详解(转自 学无止境-yj)

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  3. Spring MVC配置文件的三个常用配置详解

    转自:http://www.cnblogs.com/benwu/articles/5162614.html Spring MVC项目中通常会有二个配置文件,sprng-servlet.xml和appl ...

  4. spring mvc 配置文件拦截器过滤url

    最近在用spring mvc拦截器,sprin 版本号4.0.6.RELEASE, <mvc:interceptor> <mvc:mapping path="/admin/ ...

  5. spring配置文件和spring mvc配置文件的区别

    Question: Are applicationContext.xml and spring-servlet.xml related anyhow in Spring Framework? Will ...

  6. spring mvc 配置文件信息记录

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  7. Spring MVC配置文件

    都说开发Spring Web程序的配置文件很繁琐,所以就写了一篇配置博客, 首先是pom.xml文件 <project xmlns="http://maven.apache.org/P ...

  8. spring mvc配置文件dispatcher-servlet.xml详解

    Spring的配置文档<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="ht ...

  9. Spring MVC 配置文件

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

随机推荐

  1. C#程序以管理员权限运行【我采用了第二种,比较好用】

    在Vista 和 Windows 7 及更新版本的操作系统,增加了 UAC(用户账户控制) 的安全机制,如果 UAC 被打开,用户即使以管理员权限登录,其应用程序默认情况下也无法对系统目录.系统注册表 ...

  2. 3D变形旋转

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  3. js中event.target和event.srcElement的区别

    看了很多资料绝对结果就是 firefox 下的 event.target = IE 下的 event.srcElement jquery中的event.target属性的作用是获取到出发事件的元素.j ...

  4. [saiku] olap数据源管理

    一.应用场景 系统初始化的时候 如果没有创建olap数据源需要先创建olap数据源 否则直接获取所有的数据源存放在全局变量datasources里面以便于后续步骤中获取plap-connections ...

  5. sleep函数

    Linux下: #include <unistd.h> sleep(1); // 睡眠1秒 usleep(1); // 睡眠1微妙

  6. 定向转发和重定向实现 <select >下拉表单数据传送

    定向转发的特点:   (1). 实行转发时浏览器上的网址不变  (如果你这点忽视了,那你就要接受我无尽的鄙视吧! 哇咔咔~~~)    (2). 实行转发时 :   只有一次请求.  不信,看这下面的 ...

  7. 318. Maximum Product of Word Lengths ——本质:英文单词中字符是否出现可以用26bit的整数表示

    Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the tw ...

  8. asp.net core StaticFiles中间件修改wwwroot

    new StaticFileOptions() { FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentD ...

  9. 碰到sshd连接不上linux时的解决办法

    1,首先更改ssh配置,可以是ssh端口连接不上服务器 cd /etc/ssh/sshd_config vi !$ Port 52113 //ssh默认的连接端口, 改为别人不知道的端口 Permit ...

  10. git 安装或者更新

    1. 安装编译git时需要的包 # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel # yum in ...