1. 程式人生 > >Spring Boot 中 Controller 使用

Spring Boot 中 Controller 使用

class boot ping pin highlight pat 分享圖片 img light

1.屬性配置

技術分享圖片

2.Controller使用

技術分享圖片

技術分享圖片

2.@PathVariable 與 @RequestParam 的區別

(1)@PathVariable

技術分享圖片

技術分享圖片

(2)@RequestParam

技術分享圖片

技術分享圖片

3.@GetMapping 和 @PostMapping 簡寫

@RequestMapping(value="/say", method=RequestMethod.GET)
// 等同於
@GetMapping(value="/say")

技術分享圖片

Spring Boot 中 Controller 使用