Code example for Locale

Methods: toString

	 * Simply selects the home view to render by returning its name. 
	@RequestMapping(value = "/", method = RequestMethod.GET) 
	public String home(Locale locale, Model model) {"Welcome home! the client locale is "+ locale.toString());
		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
		String formattedDate = dateFormat.format(date);
		model.addAttribute("serverTime", formattedDate );
		return "home"; 
Stop searching for code, let great code find you!  Add Codota to your java IDE