zoukankan      html  css  js  c++  java
  • SpringBoot常用注解

    1、@Controller

    @Controller 用来响应页面,表示当前的类为控制器。

    2、@RestController

    @RestController 是@ResponseBody和@Controller的结合
    表明当前类是控制器且返回的是一组数据,不是页面

    3、@Autowired

    这个注解的作用是将其他的类,接口引入,类似于之前的类的初始化等,用这个注解,类中或接口的方法就可以直接调用了。

    4、@RequestMapping

    当前台界面调用Controller处理数据时候告诉控制器怎么操作
    作用:URL映射。

    5、@GetMapping

    @RequestMapping(method = RequestMethod.GET)的简写
    作用:对应查询,表明是一个查询URL映射

    6、@PostMapping

    @RequestMapping(method = RequestMethod.POST)的简写
    作用:对应增加,表明是一个增加URL映射

    7、@PutMapping

    @RequestMapping(method = RequestMethod.PUT)的简写
    作用:对应更新,表明是一个更新URL映射

    8、@DeleteMapping

    @RequestMapping(method = RequestMethod.DELETE)的简写
    作用:对应删除,表明是一个删除URL映射
    ————————————————
    版权声明:本文为CSDN博主「唐_方」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_39031310/article/details/83415470

  • 相关阅读:
    常见逻辑谬误
    4 WPF依赖属性
    11 WPF样式和行为
    17 WPF控件模板
    3 WPF布局
    4.6.3 The LRParsing Algorithm
    4.6 Introduction to LR Parsing: Simple LR
    19 WPF 数据绑定
    分布式系统部署、监控与进程管理的几重境界
    运维知识体系
  • 原文地址:https://www.cnblogs.com/xtxt1127/p/11738087.html
Copyright © 2011-2022 走看看