<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="true">
<!-- 因为controller没有实现接口 所以必须强制使用CGLIB代理 配置proxy-target-class="true" 否则报错-->
<aop:aspectj-autoproxy proxy-target-class="true"/> <context:component-scan base-package="cn.edu.hbcf">
<!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/> -->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
</context:component-scan>
<!-- 该 BeanPostProcessor 将自动起作用,对标注 @Autowired 的 Bean 进行自动注入 -->
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/> <!-- 用于持有applicationProperties,将properties转变为静态方法使用,PropertiesHolder.getProperty("somekey") -->
<!-- PropertyPlaceholderConfigurer,用于spring ${placeholder}的解析 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"></property>
<property name="properties" ref="applicationProperties"></property>
</bean>
<!-- 激活 @Required @Autowired,JSR 250's @PostConstruct, @PreDestroy and @Resource 等标注 -->
<context:annotation-config /> <!-- 对某些静态资源,如css,图片等进行过滤 ,有引用 "/resources/**" 的路径引用转到工程的/resources/目录取资源 -->
<!-- <mvc:resources mapping="/favicon.ico" location="/favicon.ico"/> -->
<mvc:resources mapping="/resources/**" location="/resources/,/lib/" />
<mvc:resources mapping="/app/**" location="/app/" />
<mvc:resources mapping="/front/**" location="/front/" />
<mvc:resources mapping="/plugins/**" location="/plugins/" />
<mvc:resources mapping="/upload/**" location="/upload/" />
<mvc:resources mapping="/skin/**" location="/skin/" />
<!-- 简单的地址映射 -->
<!-- Forwards requests to the "/" resource to the "welcome" view
<mvc:view-controller path="/admin" view-name="/admin/login" />
--> <!-- <mvc:annotation-driven /> -->
<!-- Configures support for @Controllers <mvc:annotation-driven/>相当于注册了DefaultAnnotationHandlerMapping
和AnnotationMethodHandlerAdapter两个bean,配置一些messageconverter。即解决了@Controller注解的使用前提配置。
如果不用这个,则要声明下面2个bean-->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<!-- 定义一个全局的转化器,转化Date、Int、Double类型数据 -->
<property name="webBindingInitializer">
<bean class="cn.edu.hbcf.common.springmvc.MyWebBindingInitializer"/>
</property>
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes" value="application/json"/>
</bean>
</list>
</property>
</bean>
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
</bean> <!-- jsp视图 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<!-- 访问时添加的默认前缀 -->
<property name="prefix" value="/" />
<!-- 访问时添加的默认后缀 -->
<property name="suffix" value=".jsp" />
</bean> <!-- 国际化,并且可以批定文件编码,可以使用classpath: 或者WEB-INF/ 前缀 -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:messages</value>
<value>classpath:ValidationMessages</value>
</list>
</property>
<property name="defaultEncoding" value="UTF-8" />
<property name="cacheSeconds" value="60" />
</bean> <!-- 针对类、方法级别的权限拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/main*" />
<mvc:mapping path="/header*" />
<mvc:mapping path="/welcome*" />
<mvc:mapping path="/treeMenu*" />
<mvc:mapping path="/role**/**" />
<mvc:mapping path="/user**/**" />
<mvc:mapping path="/module**/**" />
<mvc:mapping path="/field**/**"/>
<mvc:mapping path="/baseFlow**/**"/>
<mvc:mapping path="/baseNode**/**"/>
<mvc:mapping path="/myWelcome/**"/>
<bean class="cn.edu.hbcf.privilege.web.interseptor.LoginInterceptor"></bean>
</mvc:interceptor> <mvc:interceptor> <mvc:mapping path="/**/*" />
<bean class="cn.edu.hbcf.privilege.web.interseptor.PrivilegeInterceptor"></bean>
</mvc:interceptor> </mvc:interceptors> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" /> <!-- 文件上传 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 解析request的编码 ,Default is ISO-8859-1 -->
<property name="defaultEncoding" value="UTF-8" />
<!-- 设置最大允许的大小(字节)。-1表示没有限制(默认) 1024*1024*10=10MB -->
<property name="maxUploadSize" value="1048576000" />
<!--被允许的最大的内存的大小,Default is 10240 bytes -->
<property name="maxInMemorySize" value="20480" />
</bean> </beans>

springmvc-servlet.xml的更多相关文章

  1. springMvc配置xml使ResponseBody返回Json

    @ResponseBody 在返回的数据不是html标签的页面,而是其他某种格式的数据时(如json.xml等)使用: 不在springMvc中配置json的处理的话,我们通常会在Controller ...

  2. springmvc 项目完整示例07 设置配置整合springmvc springmvc所需jar包springmvc web.xml文件配置

    前面主要是后台代码,spring以及mybatis的整合 下面主要是springmvc用来处理请求转发,展现层的处理 之前所有做到的,完成了后台,业务层和持久层的开发完成了 接下来就是展现层了 有很多 ...

  3. springmvc web.xml配置之 -- DispatcherServlet

    springMVC servlet配置与启动 看一下springmvc的web.xml常见配置: <servlet> <!-- 配置DispatcherServlet --> ...

  4. Tomcat配置文件之servlet.xml中选项介绍

    Servlet.xml 分为以下元素: server, service, Connector ( 表示客户端和service之间的连接), Engine ( 表示指定service 中的请求处理机,接 ...

  5. springmvc 返回xml

    需求: 1.springmvc返回xml: 技术及环境: Spring 4.3.1.RELEASE JDK 1.8 IDEA 15.0.6 Maven 3 实现: spirngxml的配置主要如下: ...

  6. tomcat中配置servlet.xml的JNDI或JDBC连接数据库【原】

    tomcat中配置servlet.xml的JNDI或JDBC连接数据库 一. JNDI 1. tomcat环境 找到X:\xxx\......\apache-tomcat-6.0.39\conf\se ...

  7. servlet.xml 出现 Referenced file contains errors(http://.......)

    问题描述: 打开Eclipse突然发现Web工程的servlet.xml突然报了红叉叉,错误信息如下: Referenced file contains errors (http://www.spri ...

  8. Tomcat中的Web.xml和servlet.xml的学习

    Web.xml文件使用总结 作用: 存储项目相关的配置信息,保护servlet.解耦一些数据对程序的依赖 使用位置: 每个web项目中 Tomcat服务器中(在服务器目录conf目录中) 区别: We ...

  9. springmvc web.xml配置之 -- SpringMVC IOC容器初始化

    SpringMVC IOC容器初始化 首先强调一下SpringMVC IOC容器初始化有些特别,在SpringMVC中除了生成一个全局的spring Ioc容器外,还会为DispatcherServl ...

  10. springmvc 解析xml数据

    springmvc 解析xml数据 http://blog.csdn.net/zhi_jun/article/details/37925475

随机推荐

  1. python 机器学习中的数据处理学习记录

    在机器学习中,选择合适的算法固然重要,但是数据的处理也同样重要.通过对数据的处理,能提高计算效率,提高预测识别精确度等等 以下记录下一些数据处理的方法 一.处理缺失值 对于数据集中有缺失值的,粗暴的方 ...

  2. metal的gpu query

    https://developer.apple.com/documentation/metal/mtlcommandbuffer/1639924-gpustarttime gpuStartTime 看 ...

  3. Django出现的错误1.TypeError: view must be a callable or a list/tuple in the case of include().1.TypeError: view must be a callable or a list/tuple in the case of include().

    .TypeError: view must be a callable or a list/tuple in the case of include(). 原因: url(r"^upload ...

  4. DevExpress 小计 GridControl 隔行换行

    摘自: http://www.cnblogs.com/yuerdongni/archive/2012/09/08/2676753.html 1. 如何解决单击记录整行选中的问题 View->Op ...

  5. (转)dubbo design

    框架设计 整体设计 图例说明: 图中左边淡蓝背景的为服务消费方使用的接口,右边淡绿色背景的为服务提供方使用的接口, 位于中轴线上的为双方都用到的接口. 图中从下至上分为十层,各层均为单向依赖,右边的黑 ...

  6. 【DataStrcutre】Introduction and description of Binary Trees

    [Definitions] Here is the recursive definition of a binary tree: A binary tree is either the empty s ...

  7. MyCAT学习总结

    MyCAT介绍 简单的说,MyCAT就是: 一个彻底开源的,面向企业应用开发的“大数据库集群” 支持事务.ACID(指数据库事务正确执行的四个基本要素的缩写.包含:原子性(Atomicity).一 ...

  8. kindeditor 图片上传插件

    富文本编辑器,kindeditor是比较好用的一款.需要的功能都有,文档.demo也详细.有什么功能去官网看一眼就好. 官网:http://kindeditor.net/ 一些好用的如图片上传,kin ...

  9. tornado zbar 二维码识别 ,配合nginx 反向代理,supervisord 监控

    tornado zbar 二维码识别 ,配合nginx 反向代理,supervisord 监控 1.zbar识别二维码程序,python2.6.6 #!/usr/bin/env python # co ...

  10. SSH框架之Struts(4)——Struts查漏补缺BeanUtils在Struts1中

    在上篇博客SSH框架之Struts(3)--Struts的执行流程之核心方法,我们提到RequestProcessor中的processPopulate()是用来为为ActionForm 填充数据.它 ...