@RestController
@RestContr相当于@Controller+@ResponseBody注解
如果使用@RestController注解Controller中的方法无法返回页面,相当于在方法上面自动加了@ResponseBody注解,所以没办法跳转并传输数据到另一个页面,所以InternalResourceViewResolver也不起作用,返回的内容就是Return中的内容
GetMapping
@GetMapping注解是@RequestMapping(method=RequestMethod.GET)的缩写
PostMapping
@PostMapping注解是@RequestMapping(method=RequestMethod.POST)的缩写
PutMapping
@PutMapping注解是@RequestMapping(method=RequestMethod.PUT)的缩写
DeleteMapping
@DeleteMapping注解是@RequestMapping(method=RequestMethod.DELETE)的缩写