zoukankan      html  css  js  c++  java
  • @getMapping与@postMapping

    首先要了解一下@RequestMapping注解。

      @RequestMapping用于映射url到控制器类的一个特定处理程序方法。可用于方法或者类上面。也就是可以通过url找到对应的方法。

      @RequestMapping有8个属性。

    value:指定请求的实际地址。

    method:指定请求的method类型(GET,POST,PUT,DELETE)等。

    consumes:指定处理请求的提交内容类型(Context-Type)。

    produces:指定返回的内容类型,还可以设置返回值的字符编码。

    params:指定request中必须包含某些参数值,才让该方法处理。

    headers:指定request中必须包含某些指定的header值,才让该方法处理请求。

    @getMapping与@postMapping是组合注解。

    @getMapping = @requestMapping(method = RequestMethod.GET)。

    @postMapping = @requestMapping(method = RequestMethod.POST)。

  • 相关阅读:
    UVa 482
    UVa 10360
    UVa 10812
    UVa 10420
    UVa 573
    UVa 357
    UVa 147
    UVa 674
    郑厂长系列故事——逃离迷宫 HDU4524
    威威猫系列故事——过生日 HDU 4523
  • 原文地址:https://www.cnblogs.com/rinack/p/9952795.html
Copyright © 2011-2022 走看看