Spring的配置文档
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.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">
<!-自动扫描controller--->
<context:component-scan base-package="com.zenointel.p2p.web.controller"/>
<!--验证器-->
<mvc:annotation-driven validator="validtor">
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieMaxAge" value="31536000" />
</bean>
<!-定义映射-->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/services/**"/>
<mvc:exclude-mapping path="/css/**"/>
<mvc:exclude-mapping path="/js/**"/>
<mvc:exclude-mapping path="/img/**"/>
<mvc:exclude-mapping path="/fonts/**"/>
<mvc:exclude-mapping path="/webfile/**"/>
<mvc:exclude-mapping path="/theme/**"/>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/services/**"/>
<mvc:exclude-mapping path="/css/**"/>
<mvc:exclude-mapping path="/js/**"/>
<mvc:exclude-mapping path="/img/**"/>
<mvc:exclude-mapping path="/fonts/**"/>
<mvc:exclude-mapping path="/webfile/**"/>
<mvc:exclude-mapping path="/theme/**"/>
<bean class="com.zenointel.p2p.web.interceptor.P2PInterceptor"/>
</mvc:interceptor>
</mvc:interceptors> <mvc:resources mapping="/favicon.ico" location="/"/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/js/**" location="/js/"/>
<mvc:resources mapping="/img/**" location="/img/"/>
<mvc:resources mapping="/fonts/**" location="/fonts/"/>
<mvc:resources mapping="/theme/**" location="/theme/"/>
<!-定义视图(视图解析器)>
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/> <!-jsp都放在WEB-INF/jsp目录下->
<property name="suffix" value=".jsp"/> <!-jsp页面的后缀都是.jsp-->
</bean> <bean id="captchaProducer"
class="com.google.code.kaptcha.impl.DefaultKaptcha">
<property name="config">
<bean class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">100</prop>
<prop key="kaptcha.image.height">30</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.textproducer.font.size">30</prop>
<prop key="kaptcha.textproducer.font.color">black</prop> </props>
</constructor-arg>
</bean>
</property>
</bean>
<!--================ 中文国际化================-->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messageSource"/>
<property name="cacheSeconds" value="300"/>
</bean> <bean id="validtor" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource"/>
</bean>
<!--================ 文件上传================-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="20971520"/>
<property name="resolveLazily" value="true"/>
</bean> <context:property-placeholder order="1" location="classpath:application.xml" /> <bean id="webConfig" class="com.zenointel.p2p.web.util.WebConfig" /> </beans>

spring mvc配置文件dispatcher-servlet.xml详解的更多相关文章

  1. spring boot 配置文件properties和YAML详解

    spring boot 配置文件properties和YAML详解 properties中配置信息并获取值. 1:在application.properties配置文件中添加: 根据提示创建直接创建. ...

  2. spring, spring mvc, mybatis整合文件配置详解

    转自:http://www.cnblogs.com/wxisme/p/4924561.html 使用SSM框架做了几个小项目了,感觉还不错是时候总结一下了.先总结一下SSM整合的文件配置.其实具体的用 ...

  3. 1-2 hibernate主配置文件hibernate.cfg.xml详解

    详 http://www.cnblogs.com/biehongli/p/6531575.html Hibernate的主配置文件hibernate.cfg.xml 1:Hibernate的主配置文件 ...

  4. Spring MVC的原理及配置详解

    网址链接:https://www.cnblogs.com/baiduligang/p/4247164.html

  5. spring MVC请求处理类注解属性详解

  6. Tomcat配置(二):tomcat配置文件server.xml详解和部署简介

    */ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; } .hl ...

  7. Tomcat(二):tomcat配置文件server.xml详解和部署简介

    Tomcat系列文章:http://www.cnblogs.com/f-ck-need-u/p/7576137.html 1. 入门示例:虚拟主机提供web服务 该示例通过设置虚拟主机来提供web服务 ...

  8. logback的使用和logback.xml详解,在Spring项目中使用log打印日志

    logback的使用和logback.xml详解 一.logback的介绍 Logback是由log4j创始人设计的另一个开源日志组件,官方网站: http://logback.qos.ch.它当前分 ...

  9. Logback简介及配置文件logback.xml详解

    logback简介及配置文件说明 @author:wangyq @date:2021年3月31日 logback简介 ​ Logback是由log4j创始人设计的另一个开源日志组件,官方网站: htt ...

  10. Maven配置文件setting.xml详解

    注:本文来源于:大话JAVA的那些事 <Maven配置文件setting.xml详解> <?xml version="1.0" encoding="UT ...

随机推荐

  1. PHP生成token防止表单重复提交

    .提交按钮置disabled 当用户提交后,立即把按钮置为不可用状态.这种用js来实现. 提交前代码如下: $()  {  $exec="insert into student (user_ ...

  2. 免费电子书:使用VS Online敏捷管理开源项目

    今天推荐的是一本由微软出版社发布的免费电子书,涉及的话题是如何在Visual Studio Online中基于敏捷的思想来管理开源项目. 本书的几位作者(自称ALM领域的游侠),给大家分享了在一个敏捷 ...

  3. java_final关键字的使用

    final : 最终.作为一个修饰符,1,可以修饰类,函数,变量.2,被final修饰的类不可以被继承.为了避免被继承,被子类复写功能.3,被final修饰的方法不可以被复写.4,被final修饰的变 ...

  4. WCF客户端关闭代码

      Close不一定会成功,所以需要Abort. ChannelFactory channel = new ChannelFactory<IService1>("bindingN ...

  5. BZOJ2851 : 极限满月

    把集合A[i]看作i点的前驱点集合,建成一个DAG,并新建超级源S,向每个前驱集合为空的点连边,那么B[i]就是S到i的必经点集合. 首先使用Lengauer-Tarjan算法建立出以S为起点的Dom ...

  6. BZOJ3046 : lagoon

    码农题,拆点BFS预处理出所有联通块的面积即可,注意分类讨论. #include<cstdio> #include<cmath> using namespace std; co ...

  7. 【转】eclipse插件开发,调试运行,导出与安装

    [转自]http://www.kankanews.com/ICkengine/archives/61043.shtml 文章来自KENGINE | Kankanews.com 摘要: 本文主要讲ecl ...

  8. JS生成随机的由字母数字组合的字符串

    前言 最近有个需求,是需要生成3-32位长度的字母数字组合的随机字符串,另一个是生成43位随机字符串. 方法一 奇妙的写法   1 Math.random().toString(36).substr( ...

  9. 10个国内外jQuery的CDN性能大比拼

    jQuery是前端开发最常见也是最流行的javascript库,如何去加载它才能使我们的项目性能更好以及问什么要用CDN?当用户访问自己的站点时从服务器加载文件,每个服务器同时只能下载2-4个文件,这 ...

  10. 20145315 《Java程序设计》实验三实验报告

    实验三 敏捷开发与XP实践 实验内容 下载并学会使用git上传代码: 与同学结对,相互下载并更改对方代码,并上传: 实现代码的重载. 实验步骤 下载并用git上传代码: 1.下载并安装好git,在cm ...