yz-bky

@RestController

  @RestController相当于@Controller+@ResponseBody注解

  如果使用@RestController注解,Controller中的方法将无法返回页面,相当于方法上自动加了@ResponseBody注解

  所以没法跳转并传输数据到另一个页面,所以InternalResourceViewResolver也不起作用,返回的就是Return里的内容

@GetMapping

  @GetMapping注解是@RequestMapping(method=RequestMethod.GET)的缩写

@PostMapping

  @PosttMapping注解是@RequestMapping(method=RequestMethod.POST)的缩写

@PutMapping

  @PutMapping注解是@RequestMapping(method=RequestMethod.PUT)的缩写

@DeleteMapping

  @DeleteMapping注解是@RequestMapping(method=RequestMethod.DELETE)的缩写

分类:

技术点:

相关文章:

  • 2022-03-02
  • 2021-11-21
  • 2022-02-09
  • 2021-08-29
  • 2021-11-19
  • 2021-11-19
  • 2021-11-19
猜你喜欢
  • 2021-12-06
  • 2021-09-07
  • 2022-03-07
  • 2021-11-26
  • 2022-02-19
  • 2021-11-19
相关资源
相似解决方案