该标签隐式的向Spring容器注册了:
  AutowiredAnnotationBeanPostProcessor
  CommondAnnotationBeanPostProcessor
  PersistenceAnnotationBeanPostProcessor
  RequiredAnnotationBeanPostProcessor
这四个BeanPostProcessor.

 
1.AutowiredAnnotationBeanPostProcessor:主要是使用@AutoWired注解时,必须提前向Spring容器注册这个BeanPostprocessor
传统的配置方式:<bean class="org.springframework.beans.factory.annotation. AutowiredAnnotationBeanPostProcessor "/>
 
2.CommondAnnotationBeanPostprocessor:主要是使用@Resource、@PostConstruct、@Predestory等注解时,必须提前向Spring容器注册。
传统配置方式:<bean class="org.springframework.beans.factory.annotation.CommondAnnotationBeanPostprocessor"/>
 
3.PersistenceAnnotationBeanPostProcessor :主要是使用@PersistenceContext注解时,必须提前向Spring容器注册。
传统配置方式:<bean class="org.springframework.beans.factory.annotation.PersistenceAnnotationBeanPostProcessor"/>
 
4.RequiredAnnotationBeanPostProcessor:主要是使用@Required注解时,必须提前向Spring容器注册。
传统配置方式:<bean class="org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor"/>
 
一般来说,@Autowired注解比较常用,传统配置方式有点繁琐,而这种隐式配置方式就可以帮我们很容易的搞定。
不过使用注解,我们一般都会配置扫描包路径:<context: component-scan base-package=com.xxx.xxx />
其实,给配置已经包含了自动注入上述Processor的功能,所以,配置了包扫描之后,<context annotation-config />就可以移除了。
 

QQ技术交流群:576269252

--------------------------------------

声明: 原创文章,未经允许,禁止转载!

--------------------------------------

<context annotation-config />标签意义的更多相关文章

  1. Mingyang.net:org.springframework.context.annotation.ConflictingBeanDefinitionException

    org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean ...

  2. 【原创】大叔经验分享(16)Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    今天尝试运行一个古老的工程,配置好之后编译通过,结果运行时报错: org.springframework.beans.factory.BeanDefinitionStoreException: Une ...

  3. spring 2.5.6 错误:Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    在运行一个第三方公司交付的项目的时候, 出现: Caused by: java.lang.IllegalStateException: Context namespace element 'annot ...

  4. context、config

    Tomcat启动时已经创建了context,并使用它读取了web.xml中的参数,后台可以从context里获取参数 后台获取参数代码: ServletContext context = getSer ...

  5. Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser]

    严重: Exception sending context initialized event to listener instance of class org.springframework.we ...

  6. class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    在搭建SSM项目时报了以下的错误: 06-Oct-2019 11:55:52.109 信息 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina. ...

  7. SpringAOP中的aop:config标签

    我们使用Spring的AOP功能的时候发现,我们使用普通的配置方式的时候,我们无法精确的确定将切面类中的哪个方法切入到哪个切入点上, 所以我们可以使用aop的专用标签来完成相关的配置.其中主要表现是使 ...

  8. [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher 问题--MyEclipse设置JDK版本

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc ...

  9. Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    异常信息如下: 错误: Unexpected exception parsing XML document from class path resource [spring/applicationCo ...

  10. Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

    Context namespace element 'annotation-config' and its parser class [org.springframework.context.anno ...

随机推荐

  1. 关于jquery 取值,赋值常用控件的问题

    一.文本框 对于单个文本框: 1.获取文本框: $("#id").val() 2.赋值: $("#id").val("赋值"); 或 (清空 ...

  2. ubuntu for win10 里运行apache+php

    一直想试试ubuntu for win10中运行网站测试一下,弄了好久,今天终于基本弄明白了, ubuntu for win10里的IP就是外面WIN10的IP,在里面建立网站了可以直接在外面WIN1 ...

  3. Go1.5正式版程序性能分析小积累,实验环境windows64

    方法一: 内存分配器跟踪:GODEBUG=allocfreetrace=1 调度器追踪 调度器追踪能够提供对 goroutine 调度的动态行为的内视,而且同意调试负载平衡和可扩展性问题.要启用调度器 ...

  4. lua -- 商店的数据管理类

    module (..., package.seeall) local ShopM = {} local SystemPrompt = require(__APP_PACKAGE_NAME__ .. & ...

  5. STL deque用法

    Deque 容器 deque容器是C++标准模版库(STL,Standard Template Library)中的部分内容.deque容器类与vector类似,支持随机访问和快速插入删除,它在容器中 ...

  6. Windows下使用第三方lua库

    第三方库lua和dll文件可以直接放在lua解释器目录下, > print(package.cpath)D:\lua-5.2.3\src\?.dll;D:\lua-5.2.3\src\loada ...

  7. FFmpeg filter简介

    [时间:2016-08] [状态:Open] [关键词:FFmpeg, filter, filter graph,命令行] 1. 引言及示例 FFmpeg中的libavfilter提供了一整套的基于f ...

  8. Android.mk遍历子目录所有文件

    转:http://blog.csdn.net/langresser_king/article/details/8272736 define all-cpp-files-under$(patsubst ...

  9. 豆瓣源安装requirements.txt

    豆瓣源安装requirements.txt pip install -i https://pypi.doubanio.com/simple/ -r requirements.txt

  10. mysql 添加外键时 error 150 问题总汇

    当你试图在mysql中创建一个外键的时候,这个出错会经常发生,这是非常令人沮丧的.像这种不能创建一个.frm 文件的报错好像暗示着操作系统的文件的权限错误或者其它原因,但实际上,这些都不是的,事实上, ...