I'd like to use one URL mapping /all
with request parameters (month
, date
) or without parameters.
I've tried to create two methods, one without parameters:
@RequestMapping(value = "/all", method = RequestMethod.GET)
public CommonResponse getAll() {
}
And one with parameters:
@RequestMapping(value = "/all", method = RequestMethod.GET)
public CommonResponse getByMonth(@RequestParam int month, @RequestParam(required = false) int year) {
}
But i am getting "Ambiguous mapping found" IllegalStateException
. Does Spring have any way to handle this situation?
Note:- Please don't suggest this solution because I have different scenario.