@Component可将pojo实例化到Spring容器中,类似于@Bean用法 #1
CompetitiveLin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
此处的
@Component
与此处的@Bean
作用一致,都是将该类注入到Spring中。但是考虑到此处需要调用Bean对象,因此还是@Bean
更方便,否则需要在原处替换成new JwtAuthenticationTokenFilter()
。Beta Was this translation helpful? Give feedback.
All reactions