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. Theano在CentOS 6 下的安装及GPU加速

    系统版本:Red Hat 4.4.6-4 一. 未联网情况下,选择本地安装. 首先安装theano的依赖库,包括:scipy-0.16.1numpy-1.9.2nose-1.3.7 (optional ...

  2. matlab练习程序(多圆交点)

    最近总是对计算几何方面的程序比较感兴趣. 多圆求交点,要先对圆两两求交点. 有交点的圆分为相切圆和相交圆. 相切圆求法: 1.根据两圆心求直线 2.求公共弦直线方程 3.求两直线交点即两圆切点. 相交 ...

  3. 一件关于数据库日志log的无聊事情

    为何说是无聊的记录呢? 因为事先把问题想复杂了,事后发现的时候觉得更是无聊的行为.还是写下来,毕竟很少弄这么无聊的事情. 事情起因是需要给服务器做性能基数(baseline),用sqldiag 提取了 ...

  4. php 批量生成html、txt文件

    首先建立一个conn.php的文件用来链接数据库 <?php     $link = mysql_connect("mysql_host" , "mysql_use ...

  5. MySQL监控系统MySQL MTOP的搭建

    MySQLMTOP是一个由Python+PHP开发的MySQL企业级监控系统.系统由Python实现多进程数据采集和告警,PHP实现WEB展示和管理.最重要是MySQL服务器无需安装任何Agent,只 ...

  6. [LintCode] Trapping rain water II

    Given n x m non-negative integers representing an elevation map 2d where the area of each cell is 1  ...

  7. Codeforces 161D Distance in Tree(树的点分治)

    题目大概是,给一棵树,统计距离为k的点对数. 不会DP啊..点分治的思路比较直观,啪啪啪敲完然后AC了.具体来说是这样的: 树上任何两点的路径都可以看成是一条过某棵子树根的路径,即任何一条路径都可以由 ...

  8. POJ2553 The Bottom of a Graph(强连通分量+缩点)

    题目是问,一个有向图有多少个点v满足∀w∈V:(v→w)⇒(w→v). 把图的强连通分量缩点,那么答案显然就是所有出度为0的点. 用Tarjan找强连通分量: #include<cstdio&g ...

  9. Mesh系列文章 - 自定义Mesh

    就是在做项目的过程中,有用到三角形的,今天就写一下如何自定义三角形? 先截个图,让大家有个感性认识! //引用 using UnityEngine;        using System.Colle ...

  10. Ubuntu根目录下各文件夹的功能详细介绍

    Ubuntu的根目录下存在着很多的文件夹,但你知道他们都存放着哪些文件呢?这些是深入了解Ubuntu系统必不缺少的知识,本文就关于此做一下介绍吧. /bin/    用以存储二进制可执行命令文件. / ...