声明:
1、@Component 组件,没有明确的角色
2、@Service,业务接口实现类标注
3、@Repository, 数据层接口实现类标注
4、@Contorller,表现层类标注
注入:
@Autowired
@Autowired
@Qualifier("xxxImpl")
private xxxInterface xxxInterface;
@Inject,
@Resource
配置:
@Configuration
@ComponentSan
@Bean
Bean的Scope:
@Scope("Singleton")
@Scope("Prototype")
@Scope("Request")
@Scope("Session")
@Scope("GlobalSession")