I am trying to implement a Rest Api,the code seems correct and simple but i am getting this error and I can't figure out the problem.
The Log is outputting the following.
2017-10-10 14:49:40.946 WARN 5750 --- [nio-8080-exec-4] o.s.web.servlet.PageNotFound : Request method 'GET' not supported
@RestController("/report")
@CrossOrigin(origins = { "http://localhost:4200" })
public class JasperController {
@RequestMapping(value = "/allReports", method = { RequestMethod.GET }, produces = "application/json")
public String allReport() {
return "allReports!!!";
}
@RequestMapping(value = "/supportedFields", method = { RequestMethod.GET }, produces = "application/json")
public List<String> supportedFields() {
return Arrays.asList("name", "age", "address", "code", "contract");
}
}
"/allReports"
toname="/allReports"
the error will disappear but if I enter /supportedFields in the browser it will call /allReports. And if I change the two RequestMethod parameters to name instead of value then another exception is raisedThere is already '/report' bean method public java.lang.String controller.JasperController.allReport() mapped.
– SEY_91