都是以前的笔记了,有时间就整理出来了,SpringBoot接收前端参数的三种方法,首先第一种代码: @RestController public class ControllerTest { //访问路径:http://localhost:8080/hello/5 @GetMapping(value = "/hello/{id}") public String hello(@PathVariable("id") Integer id){ return "I
接收参数有三个方法. 1.接收id的方法: @RestController public class ControllerTest { //在这里读取配置文件 @Autowired private Testconfig testconfig; //访问路径:http://localhost:8080/hello/5 @GetMapping(value = "/hello/{id}") public String hello(@PathVariable("id") I
今天有个postmapping方法,地址都正确,就是死活进不去,真是奇怪了. 终于从日志中得出些端倪,见下: 只有这个属性报错,恰恰这个属性是Date型. 这句话说得更清楚: "defaultMessage":"Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'expireTime'; nested except
Failed to resolve argument 1 of type 'java.util.List' org.springframework.web.bind.MissingServletRequestParameterException: Required List parameter 'categories' is not present at org.springframework.web.method.annotation.RequestParamMethodArgumentRes