Spring Boot 入門 - 2.1 構建一個較爲複雜的 RESTful API

Spring Boot 註解說明 @Controller:修飾class,用來建立處理http請求的對象 git @RestController:Spring4以後加入的註解,原來在@Controller中返回json須要@ResponseBody來配合,若是直接用@RestController替代@Controller就不須要再配置@ResponseBody,默認返回json格式。 github
相關文章
相關標籤/搜索