SpringBoot @RestController, Ambiguous mapping found
You have to use value
attribute to define the mapping. You've used name
right now, which just provides a name to the mapping, but doesn't define any mapping at all. So currently both your methods are unmapped (in which case, both are mapped to same path). Change the methods to:
@RequestMapping(value = "/getName", method = GET)
public String getName() {
return "MyName";
}
@RequestMapping(value = "/getNumber", method = GET)
public Double getNumber(){
return new Double(0.0);
}
Or You Can use,
@GetMapping("/getName")
It is the same usage of method with value,it is new version of specifying method ="POST" with request mapping value.