Is it possible to make the @PathVariable
to return null if the path variable is not in the url? Otherwise I need to make two handlers. One for /simple
You could always just do this:
@RequestMapping(value = "/simple", method = RequestMethod.GET)
public ModelAndView gameHandler(HttpServletRequest request) {
gameHandler2(null, request)
}
@RequestMapping(value = "/simple/{game}", method = RequestMethod.GET)
public ModelAndView gameHandler2(@PathVariable("game") String game,
HttpServletRequest request) {