How do I restrict route extensions in @RequestMapping paths for Spring MVC controllers?
问题 I have a fairly simple task that I want to accomplish, but can't seem to find information for Spring MVC routing about it. I have a very simple controller that routes a path to a view: @Controller @RequestMapping(value = "/help") public class HelpController { private static final String HELP = "help"; @RequestMapping(method = RequestMethod.GET) public String help(Model model, Locale locale) { model.addAttribute("locale", locale); return HELP; } } I would like to throw a 404 if http://mysite