<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
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.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--
自动为spring容器中那些配置@aspectJ切面的bean创建代理,织入切面。
proxy-target-class属性默认为false,表示使用jdk动态代理织入增强,当配为<aop:aspectj-autoproxy proxy-target-class="true"/>时,表示使用CGLib动态代理技术织入增强。不过即使proxy-target-class设置为false,如果目标类没有声明接口,则spring将自动使用CGLib动态代理。
-->
<!-- <aop:aspectj-autoproxy /> -->
<!--配置变量注入 -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:config/*.properties</value>
<value>classpath*:prod.properties</value>
<value>file://${app_conf}/prod.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true"/>
</bean>
<!--
<mvc:annotation-driven />会自动注册DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 两个bean,是spring MVC为@Controllers分发请求所必须的。
若配置了静态资源访问,比如<mvc:resources mapping="/XXX/**" location="/XXX/"/>,则不能省略该配置,否则无法匹配到对应的handler(即需要的接口)
-->
<mvc:annotation-driven/>
<!--
<context:annotation-config/>会自动向 Spring 容器注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、PersistenceAnnotationBeanPostProcessor
以及 RequiredAnnotationBeanPostProcessor 这 4 个BeanPostProcessor。注册这4个 BeanPostProcessor的作用,就是为了你的系统能够识别相应的注解。
如果你想使用@Autowired注解,那么就必须事先在 Spring 容器中声明 AutowiredAnnotationBeanPostProcessor Bean。
如果想使用@ Resource 、@ PostConstruct、@ PreDestroy等注解就必须声明CommonAnnotationBeanPostProcessor。
如果想使用@PersistenceContext注解,就必须声明PersistenceAnnotationBeanPostProcessor的Bean。
如果想使用 @Required的注解,就必须声明RequiredAnnotationBeanPostProcessor的Bean。
-->
<context:annotation-config/>
<!--
指定Spring组件扫描的基本包路径 ,还可以通过<context:include-filter type="XXX" expression="XXX"/> 或 <context:exclude-filter type="XXX" expression="XXX"/>进行过滤
-->
<context:component-scan base-package="com.linyp.weixin"/>
<!-- 静态资源访问 -->
<mvc:resources mapping="/images/**" location="/images/"/>
<!-- 载入配置 -->
<import resource="classpath*:spring/servlet-context.xml"/>
分享到:
相关推荐
Spring核心配置文件xml模板,完整的命名空间和模式文档URI引用对。
springmvc spring mybatis 的配置文件模板 .
主要介绍了Spring 配置文件XML头部文件模板实例详解的相关资料,需要的朋友可以参考下
spring schedule 注解方式+xml 方式 实现的定时器功能
spring4-mvc-gradle-xml-hello-world, Gradle + spring 4 MVC Hello World 示例( XML ) Gradle --spring-4 MVC Hello Worldspring 4 MVC + JSP视图+ XML配置模板,使用Gradle构建工具。使用的###1. 技术Gradle 2.0...
springcloud微服务项目,web日志logback配置文件的模版
springsecurity自动注销Java配置和XML配置Spring Security登录和自动注销实现该存储库具有使用开发的Spring项目JDK 8 org.springframework-version-5.1.8.RELEASE spring-security.version-5.1.5.RELEASE hibernate....
spring-mvc.xml
下面列举的是一份比较完整的配置文件模板,文档中各XML标签节点的基本用途也给出了详细的解释,这些XML标签节点在后续的知识点中均会用到,熟练掌握了这些XML节点及属性的用途后,为我们动手编写配置文件打下坚实的...
springMvcXmlTemplate Spring MVC项目的基本模板,具有基于XML的Spring配置。
让spring boot 支持mybatis的xml配置格式,以及支持jsp模板
1.34 Spring Boot导入XML配置 1.35 Spring Boot使用@SpringBootApplication注解 1.36 Spring Boot 监控和管理生产环境 1.37 Spring Boot的启动器Starter详解 1.38 Spring Boot集成Redis实现缓存机制 1.39 Spring ...
Spring Boot Thymeleaf提供了一个便捷的方式来在Spring Boot应用程序中使用Thymeleaf模板引擎,简化了开发过程,并提供了丰富的功能和灵活的配置选项。Spring Boot Thymeleaf提供了一个便捷的方式来在Spring Boot...
b 编写实体类,加入hibernate注解,编写方法类测试类,在applicationContext.xml中添加hibernate模板类配置以及包扫描语句 。在类中添加spring bean注解。 c 测试类中 主动解析applicationContext.xml ,获取bean ...
第9章:介绍了Spring事务管理的工作机制,通过XML、注解等方式进行事务管理配置,同时还讲解了JTA事务配置知识。 第10章:对实际应用中Spring事务管理各种疑难问题进行透彻的剖析,让读者对Spring事务管理不再有...
上面, 我们在 web.xml 文件中告诉 ContextLoaderListener, 我们还有另外两个配置文件 /WEB-INF/database.xml 和 /WEB-INF/applicationContext.xml. applicationContext.xml: 1 <?xml version="1.0" encoding=...
5.1.8.4以XML配置的 形式 119 拓展: 120 5.1.8.5以注解方式配置 125 拓展: 127 5.1.9使用CGLIB以XML形式配置事务 130 5.2 Spring+Hibernate 131 5.2.1 HibernateTemplate模板 131 5.2.2 声明式事务 131 配置XML...
2.2.1. 更简单的XML配置 2.2.2. 新的bean作用域 2.2.3. 可扩展的XML编写 2.3. 面向切面编程(AOP) 2.3.1. 更加简单的AOP XML配置 2.3.2. 对@AspectJ 切面的支持 2.4. 中间层 2.4.1. 在XML里更为简单的声明性事务配置 ...
springmvc工程简单模板,仅加入了spring架包,已配置web.xml、application.xml。用Tomcat部署,可直接用浏览器运行工程。