Spring
白战林
这个作者很懒,什么都没留下…
展开
-
RestController和Controller的区别
官方文档:A convenience annotation that is itself annotated with @Controller and @ResponseBody.意思是:@RestController注解相当于@ResponseBody + @Controller合在一起的作用。1)如果只是使用@RestController注解Controller,则Controller中的方法...转载 2018-05-21 15:40:18 · 17942 阅读 · 3 评论 -
@Qualifier 注解
@Autowired 注解 是根据类型自动注入如果<bean>中有多个该类型的bean,自动注入的时候会报BeanCreationException异常所以通常通过@Autowired和@Qualifier一起配合着注解。举例:例如bean中配了多个数据源。[html] view plain copy<bean class="org.springframework.jdbc.c...转载 2018-05-21 16:22:42 · 1199 阅读 · 0 评论