当前位置:网站首页>注解开发相关
注解开发相关
2022-07-30 07:37:00 【晓白夏】
启动注解
启动注解扫描,加载类中配置的注解项
<context:component-scan base-package="packageName"/>
bean的定义
@Component @[email protected]@[email protected]
作用:设置该类为spring管理的bean
bean的作用域
@Scope
设置该类作为bean对应的scope属性
bean的生命周期
@PostConstruct @PreDestroy
设置该类作为bean对应的生命周期方法
加载第三方资源
@Bean
设置该方法的返回值作为spring管理的bean
bean的非引用类型属性注入
@Value
设置对应属性的值或对方法进行传参
bean的引用类型属性注入
设置对应属性的对象或对方法进行引用类型传参
bean的引用类型属性注入
@Primary
设置类对应的bean按类型装配时优先装配
bean的引用类型属性注入
@Inject @Named @Resource
加载properties文件
@PropertySource
@PropertySource(value="classpath:xxx.properties")
public class Xxx{
@Value("${propertiesAttributeName}")
private String attributeName;
}边栏推荐
猜你喜欢

C language custom types, rounding

孙洪鹤讲教材:原点+众筹+产品,逆向营销实战操作方案

SwiftUI SQLite 教程之 构建App本地数据库实现创建、读取、更新和删除(教程含完成项目源码)

开创ETC生态建设新格局 JASMINER新一批X4服务器陆续发出

数据库连接池的使用

Architectural Design Guide How to Become an Architect

39.【vector动态数组定义及初始化】
![[Mini Program Column] Summarize the development specifications of uniapp to develop small programs](/img/7b/110d324eba00652e4987bc623a5bc6.png)
[Mini Program Column] Summarize the development specifications of uniapp to develop small programs

基于SSM实现个性化健康饮食推荐系统

基于JSP实现校园二手交易平台
随机推荐
基于JSP实现校园二手交易平台
【Flask框架①】——Flask介绍
The blockbuster IP that has been popular in the world for 25 years, the new work has become a script paradise
sql 引用变量时第一位的0被去除掉如何处理
Gorm 更新零值问题
tabindex attribute of input tag & tabindex attribute of a tag
数据库连接池的使用
Delphi仿制Web的导航
【微信小程序】页面事件
SE11 创建搜索帮助
typescript4 - installs a toolkit for compiling ts
基于SSM实现个性化健康饮食推荐系统
cmd命令
实现定时器
01 多线程与高并发 - 基础概念
解构的运用
svn中文路径 权限设定
蓝牙技术|了解蓝牙LE Audio的Auracast广播音频
mysql8的my.conf配置文件参考指引
【Flask框架②】——第一个Flask项目