spring---使用注解开发
@Component::组件,放在类上,表明这个类被spring管理,就是bean
衍生出三层架构,功能相近的三个注解
bean:@Component
dao@Repository
service@Service
controller@Controller
这几个注解都表示该类被spring托管,功能一样
@Value(“小马”):给属性赋值
@Component::组件,放在类上,表明这个类被spring管理,就是bean
衍生出三层架构,功能相近的三个注解
bean:@Component
dao@Repository
service@Service
controller@Controller
这几个注解都表示该类被spring托管,功能一样
@Value(“小马”):给属性赋值