I encountered a similar situation, so we made the following default handler for these types of methods:
@RequestMapping(method = RequestMethod.POST, params = SIDE_TAB, value = "sideMenuController.xhtml") public ModelAndView changeSelectedTab(@RequestParam(SIDE_TAB) String sideTab) { return new ModelAndView("redirect:/location/" + Utils.toCamelCase(sideTab) + ".xhtml"); }
On our pages was the following:
<input type='submit' name='side-tab' value='$value' />
This, of course, meant that for the files themselves we had to have a naming standard, but it was pretty easy to guarantee (for example, "Event History" will be sent to eventHistory.xhtml, "Create a new entity", createNewEntity.xhtml, etc.) d.)
Scott source share