摘要:
在網上流行的springboot的helloworld里,由這么一段: @RestController @RequestMapping("/api") public class GreetingController { @GetMapping("/hello") public Object sayH 閱讀全文
posted @ 2025-03-05 16:44
shanxin1954
閱讀(38)
評論(0)
推薦(0)
摘要:
上一篇寫了springboot內嵌tomcat實現(xiàn)restful的簡單例子,如果要返回json,只需改變返回值的類型為對象即可: @GetMapping("/hello") public Object sayHello() { var abc = new ABC(); abc.s="june"; a 閱讀全文
posted @ 2025-03-05 14:58
shanxin1954
閱讀(104)
評論(0)
推薦(0)
摘要:
springboot已經整合了tomcat,寫一個restful的helloworld很簡單,在pom.xml里的dependencies標簽下添加spring-boot-starter-web的依賴: <dependency> <groupId>org.springframework.boot</ 閱讀全文
posted @ 2025-03-05 07:33
shanxin1954
閱讀(4)
評論(0)
推薦(0)

浙公網安備 33010602011771號