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. poj 1019

    懂了 题意是给一串 1 12 123 1234 12345 123456 ....这样的数字问第 i个数字是多少 Sample Input 2 8 3 Sample Output 2 2 #inclu ...

  2. spring 源代码地址

    spring的源代码地址发生了更改,以前的地址是 https://src.springframework.org/svn/spring-framework/.但现在spring的代码开始使用Git进行 ...

  3. 用VMware9 安装 mac 10.8和10.9搜集的资料

    VMware9虚拟机安装MAC OS X Mountain Lion 10.8.2详细图文教程 http://diybbs.zol.com.cn/1/34037_699.html vmware too ...

  4. SQL Server:查询当前服务器有多少连接请求

    有时DBA需要检查当前服务器有多少连接请求,以及连接请求的登录名,客户端版本,主机名,程序名等等之类的信息,我们就可以对服务器的连接状况有所了解,防止不明用户使用. SQL Server本身提供了这么 ...

  5. EntityFramework 6.0< Code First > 连接 Mysql数据库(转)

    http://blog.csdn.net/kmguo/article/details/19650299 网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转载的太多 ...

  6. Python实践:提取文章摘要

    一.概述 二.纯文本摘要 三.HTML摘要 一.概述 在博客系统的文章列表中,为了更有效地呈现文章内容,从而让读者更有针对性地选择阅读,通常会同时提供文章的标题和摘要. 一篇文章的内容可以是纯文本格式 ...

  7. spring实战二之Bean的自动装配(非注解方式)

    Bean的自动装配 自动装配(autowiring)有助于减少甚至消除配置<property>元素和<constructor-arg>元素,让Spring自动识别如何装配Bea ...

  8. python+pygame游戏开发之使用Py2exe打包游戏

    最近在用python+pygame 开发游戏,写完以后在分享给朋友玩的时候遇到了很大的问题,只有搭建了环境才能运行python脚本. 这会吓退99%以上的人……所以把我们的游戏打包(注意是打包而不是编 ...

  9. CodeForces Round 198

    总体感觉这次出的题偏数学,数学若菜表示果断被虐.不过看起来由于大家都被虐我2题居然排到331,rating又升了74.Div2-AA. The Walltime limit per test1 sec ...

  10. 【BZOJ】1090: [SCOI2003]字符串折叠(dp)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1090 随便yy一下.. 设f[i,j]表示i-j的最小长度 f[i, j]=min{j-i+1, f ...