<?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>

最新文章

  1. BZOJ 2083: [Poi2010]Intelligence test
  2. Android-adb 常用命令 和 sqlite
  3. hdu-5834 Magic boy Bi Luo with his excited tree(树形dp)
  4. shared_ptr&lt;&gt; reset
  5. C#中override和overload的区别
  6. 关于Java中的GUI事件处理
  7. WPF datagrid 初学
  8. 《转》在win7,boa-constructor 0.6.1 的palette面板中没有控件图标的解决方法
  9. c# Unicode字符串的解码
  10. NOIP2016DAY1题解
  11. 3409: [Usaco2009 Oct]Barn Echoes 牛棚回声
  12. java内存管理(堆、栈、方法区)
  13. vb6.0的各种SHELL,CMD内部命令、外部命令、SHELL任意文件
  14. Effective Java 第三版——29. 优先考虑泛型
  15. R语言︱噪声数据处理、数据分组——分箱法(离散化、等级化)
  16. codeforces960G. Bandit Blues
  17. three.js的组合与合并,raycaster射线无法获取group
  18. 163邮箱报错WARN: 535 Error: authentication failed.
  19. [转]node-sass 安装失败的各种坑
  20. 从零开始学HTTP (一)网络基础

热门文章

  1. nmap原理及使用方法
  2. tomcat 部署 RESTful 服务实例
  3. Hadoop 伪分布式上安装 HBase
  4. 更改Mysql数据库存储位置
  5. centos/7/isos/x86_64 下载
  6. 【Firefly API文档】—— Package Distributed
  7. CentOS安装glibc-2.14(转)
  8. X86服务器、小型机、大型机、塔式、机架式、刀片式服务器、工作站
  9. TCP/IP协议族-----21、文件传送:FTP和TFTP
  10. ORA-01400: 无法将 NULL 插入 (&quot;CHARGE_WQRL&quot;.&quot;SF_JMQTFY_T&quot;.&quot;BH&quot;)