SpringBoot常用注解

IOC:控制翻转 将Java项目中的Bean对象交给Spring容器管理(1 实例化 2 声明周期)
* 1 @Component("student"):组件 <bean id="student" class="com.cmy.entity.Student"></bean>
* 2 @Service:Service接口的实现类
* 3 @Repository:DAO接口的实现类
* 4 @Controller:Controller三层结构的控制层(接收请求 处理响应)
* DI: Dependency Injection(依赖注入)
* 5 @Resource(name=""):JDK内置的
* ByName ByType
* 6 @Autowired:Spring支持的注解
* ByType注入
* 7 @Qulified实现ByName注入
*
* Spring MVC:Controller中的注解
* 8 @ResponseBody:声明该类或该方法为一个响应体 直接将数据响应给客户端(AJAX)
* 9 @RestController:@Controller+@ResponseBody
* 10 @RequestMapping(value="请求的URL",method=RequestMethod.GET)
* //required:该参数是否必填
* //defaultValue:默认值
* 11 @RequestParam(value="",required="",defaultValue="")
* request.getParameter(String key)
* stuid stuname ===>Student stu
* 12 @PathVariable restful风格的参数传递
* 不利于在封装对象使用
*
* 13 @MapperScan(MyVBatis的注解 扫描MyBatisDAO接口的所在包)

posted @ 2019-09-08 14:34  TFE-HardView  阅读(188)  评论(0编辑  收藏  举报