Inject Spring beans into RestEasy

后端 未结 4 1098
迷失自我
迷失自我 2021-01-05 12:39

Is it possible to inject Spring beans into an RestEasy @Path class? I managed to do it with Jersey, with @InjectParam annotation, but for some other reasons, I need to switc

4条回答
  •  一个人的身影
    2021-01-05 12:51

    Simply annotate your RestEasy class with Spring's @Component and then inject your beans using Spring's @Autowired. Don't forget to include the annotation-config and component-scan elements in your spring configuration.

提交回复
热议问题