spring - 基于 Spring 函数的注入
问题描述
有什么方法可以使用@Autowired 注入spring bean,而不是使用限定符,而是使用基于函数和参数解析bean 的自定义注释?
例如
@Autowired
@FunctionQualifier(method=fetchCorrectBean)
private MyService myService;
fetchCorrectBean 是一个函数,它将从应用程序上下文中获取 bean 并将其注入。
解决方案
推荐阅读
- shell - Unix在子目录中使用SED而不修改子目录的时间戳
- reactjs - 导入路径不能以“.ts”扩展名结尾。考虑导入'src/theme.js'
- iframe - 我想使用 iframe 从网站批量下载图片,但无法获取特定的 url
- java - 模块 jdk.compiler 不会“打开 com.sun.tools.javac.processing”到未命名的模块 @4bae33a6
- django - Django如何为每个用户正确显示分页?
- php - .htaccess 不排除 PNG 文件
- css - 顺风高度过渡与反应
- python - 嵌套默认字典的更符合人体工程学的替代方案
- java - 从列表中查找总和为给定总和的数字的算法
- django - 当我尝试访问我的应用程序的仪表板时出现 ValueError((无法查询“adivaumar@domain.com”:必须是“FriendList”实例。))