Article Directory
1. GetMapping error of controller
First, there are two GetMapping("/{id1}"), GetMapping("/id2") has amgious errors
GetMapping("/info")
public AjaxResult getInfo(Request request){
//请求的参数比较多的时候使用
}
GetMapping("/info")
5. public AjaxResult getInfo(@RequestParam("name") String name){
此种是请求的参数比较少的时候使用
}
Does the following path pass when making a request? Splicing
/info?name='+name;
2. “String not const to Long ”
This kind of error occurs very frequently. It may be that which of the above two situations is not used properly.
3. Two ways to pass the value of Get
a. Path parameters such as /name/{id}
b.? splicing, such as name?id=12
c. If there are too many splicing parameters, you need to put the parameters in the class and pass a class directly