In the Spring 3.2 reference docs , section 17.3.3, Supported Method Argument Types:
The supported method arguments are as follows:
Request or response objects (Servlet API). Select any specific type of request or response, for example ServletRequest or HttpServletRequest.
(...)
java.util.Locale for the current locality request, determined by the most specific locale recognizer available, in essence, configured by LocaleResolver in the Servlet environment.
So, all you have to do is get an instance of Locale as an argument in each method:
@RequestMapping(value = "/wife/mood") public String readWife(Model model, @RequestParam("whatImDoing") String iAm, Locale loc) { if (iAm.equals("playingXbox")) { model.addAttribute("statusTitle", msgSrc.getMessage("mood.angry", null, loc)); model.addAttribute("statusDetail", msgSrc.getMessage("mood.angry.xboxdiatribe", null, loc)); } return "moodResult"; }
source share