org.springframework.web.servlet.LocaleResolver
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_PARAM_NAME
Default name of the locale specification parameter: "locale". |
| private String[] | |
| private boolean | |
| protected final Log | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| public String[] | |
| public String | getParamName()
Return the name of the parameter that contains a locale specification in a locale change request. |
| public boolean | |
| protected Locale | Returns: the correspondingLocale instancethe locale value to parse localeValue)Parse the given locale value as coming from a request parameter. |
| public boolean | preHandle(HttpServletRequest
current HTTP request request, HttpServletResponse current HTTP response response, Object chosen handler to execute, for type and/or instance evaluation handler)Overrides default org. Interception point before the execution of a handler. |
| public void | setHttpMethods(String...
the methods httpMethods)Configure the HTTP method(s) over which the locale can be changed. |
| public void | setIgnoreInvalidLocale(boolean ignoreInvalidLocale)
Set whether to ignore an invalid value for the locale parameter. |
| public void | setParamName(String paramName)
Set the name of the parameter that contains a locale specification in a locale change request. |
| DEFAULT_PARAM_NAME | back to summary |
|---|---|
| public static final String DEFAULT_PARAM_NAME Default name of the locale specification parameter: "locale". | |
| httpMethods | back to summary |
|---|---|
| private String[] httpMethods
| |
| ignoreInvalidLocale | back to summary |
|---|---|
| private boolean ignoreInvalidLocale | |
| logger | back to summary |
|---|---|
| protected final Log logger | |
| paramName | back to summary |
|---|---|
| private String paramName | |
| LocaleChangeInterceptor | back to summary |
|---|---|
| public LocaleChangeInterceptor() | |
| checkHttpMethod | back to summary |
|---|---|
| private boolean checkHttpMethod(String currentMethod) | |
| getHttpMethods | back to summary |
|---|---|
| public String[] getHttpMethods() Return the configured HTTP methods.
| |
| getParamName | back to summary |
|---|---|
| public String getParamName() Return the name of the parameter that contains a locale specification in a locale change request. | |
| isIgnoreInvalidLocale | back to summary |
|---|---|
| public boolean isIgnoreInvalidLocale() Return whether to ignore an invalid value for the locale parameter.
| |
| parseLocaleValue | back to summary |
|---|---|
| protected Locale parseLocaleValue(String localeValue) Parse the given locale value as coming from a request parameter. The default implementation calls | |
| preHandle | back to summary |
|---|---|
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException Overrides default org. Doc from org. Interception point before the execution of a handler. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler. DispatcherServlet processes a handler in an execution chain, consisting of any number of interceptors, with the handler itself at the end. With this method, each interceptor can decide to abort the execution chain, typically sending an HTTP error or writing a custom response. Note special considerations apply for asynchronous
request processing. For more details see
The default implementation returns
| |
| setHttpMethods | back to summary |
|---|---|
| public void setHttpMethods(String... httpMethods) Configure the HTTP method(s) over which the locale can be changed.
| |
| setIgnoreInvalidLocale | back to summary |
|---|---|
| public void setIgnoreInvalidLocale(boolean ignoreInvalidLocale) Set whether to ignore an invalid value for the locale parameter.
| |
| setParamName | back to summary |
|---|---|
| public void setParamName(String paramName) Set the name of the parameter that contains a locale specification in a locale change request. Default is "locale". | |