java - Spring @Autowired detection -
if have class uses spring bean, (will wired via @autowired
). noticed not class injected needs @component
class uses (inject it). why that? should not spring inject wherever @autowired
is? without having use @component
injector class?
spring processes , manages classes marked 1 of stereotype annotations @component
, @controller
, @repository
, @service
.
it not scan of classes (that make startup slow).
if class not managed spring not process of annotation inside particular class.
Comments
Post a Comment