spring注解和增强

1.添加xsd约束

 

 

xmlns:context="http://www.springframework.org/schema/context"
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd

2. component:组件

<context:component-scan base-package=""></context:component-scan>
3.几种注解

@Component("info") 不分层
@Repository("info") dao
@Service("info") biz
@Controller("info") action

@Value() 在一个类中注入普通属性值

@Resource 在一个类中注入域属性

@Autowired 在一个类中注入域属性

posted @ 2017-08-20 08:43  我的MyBatis  阅读(304)  评论(0编辑  收藏  举报