首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么在Jersey与spring框架的集成中使用@Component,@Resource,@Service?

为什么在Jersey与spring框架的集成中使用@Component,@Resource,@Service?
EN

Stack Overflow用户
提问于 2019-02-26 13:13:08
回答 1查看 92关注 0票数 0

附上我的屏幕截图,这是入门级rest类,其中使用了@Component。为什么使用@Component?

我浏览了下面的博客http://www.benchresources.net/jersey-2-x-web-service-integrating-with-spring-framework-using-annotation/

EN

回答 1

Stack Overflow用户

发布于 2019-02-26 13:23:47

使用@Component、@Resource、@Service是因为您仍在使用spring框架应用程序进行依赖注入,特别是通过组件扫描链接到找到的类,并且您希望它能够在您提供服务或dao类时自动绑定spring组件

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54878803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档