@Component注解
来源:互联网 发布:win7游戏优化版 编辑:程序博客网 时间:2024/04/28 07:53
@Component注解
类扫描的注解:
1、在spring的配置文件中导入命名空间
xmlns:context=”http://www.springframework.org/schema/context”
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
2、ruby<context:component-scan base-package="cn.itcast.annotation.scan"></context:component-scan>
1、 该注解解析器包含了两个功能:依赖注入和类扫描 2、在base-package包及子包下查找所有的类
3、如果一个类上加了@Component注解,就会进行如下的法则
如果其value属性的值为””
ruby
@Component
public class Person {}
==
<bean id="person" class="..Person">
如果其value属性的值不为”“
ruby @Component("p")
public class Person {}
==
<bean id="p" class="..Person">
4、按照@Resource的法则再次进行操作
- @Component注解
- @Component注解
- @Component注解
- @Component注解
- @Component注解
- springmvc注解之@component注解
- Spring Annotation(注解) @Component
- Spring注解@Component、
- Spring中@component注解
- spring中@Component注解
- Spring-Component注解翻译
- 注解<context:component-scan>
- @Component注解的使用
- @component的注解
- spring 注解@component 学习
- Spring 2.5 注解 Component-scan
- 注解@Component @Controller @Service @Repository
- spring注解@Component、@Repositor…
- APK瘦身方案
- J2EE的基础学习_jsp_servlet_获得连接池
- leetcode69---Sqrt(x)(求x的平方根)
- C++Primer第五版 12.1.6节练习
- 自定义键盘输入框的实现
- @Component注解
- cms系统资源路径引入
- 【LEETCODE】81-Search in Rotated Sorted Array II [Python]
- RobotFrameWork(一)robotfamework在centos下headless无界面安装
- Pandas学习笔记(一)
- ios 移动端架构浅析
- ASP.NET 4.0尚未在 Web 服务器上注册 解决方法
- 解决mysql error: Table “mysql”.“innodb_table_stats” not found
- 例子说明tell, seek, truncate基本用法