Is it possibile to set a default value to a @PathVariable in SpringMVC?
@RequestMapping(value = {"/core/organization/{pageNumber}", "/core/organization"} , method = RequestMethod.GET) public String list(@PathVariable Integer pageNumber, ModelMap modelMap) {
In this case. If I access the page without pageNumber I want to set a default value to 1.
Is that possible?
Best Answer
There's no way to to set a default value, but you can create two methods: