Spring properties in the injection comment

@Inject use

  • JSR330 specification implemented
  • The default in accordance with the type of injection
  • If you need to inject by name, @ Inject need to be used with @Name

@Resource

  • JSR250 specification implemented, requires a different packet introduced
  • @Resource is matched by name

@Autowired

  • Spring defined annotations
  • The default in accordance with the type of injection
  • If you need to use with injection by name, you need to meet @Qualifier comment
  • Contains a require property

Guess you like

Origin www.cnblogs.com/watertreestar/p/11780306.html