1 16 17 package org.springframework.web.servlet.i18n; 18 19 import java.util.Locale ; 20 21 import javax.servlet.http.HttpServletRequest ; 22 import javax.servlet.http.HttpServletResponse ; 23 24 import org.springframework.web.servlet.LocaleResolver; 25 26 38 public class AcceptHeaderLocaleResolver implements LocaleResolver { 39 40 public Locale resolveLocale(HttpServletRequest request) { 41 return request.getLocale(); 42 } 43 44 public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { 45 throw new UnsupportedOperationException ( 46 "Cannot change HTTP accept header - use a different locale resolution strategy"); 47 } 48 49 } 50 | Popular Tags |