Polishing

This commit is contained in:
Juergen Hoeller
2013-10-04 22:53:49 +02:00
parent 8b3afda6f4
commit 52cca48f40
6 changed files with 50 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.springframework.web.servlet;
import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -27,22 +26,22 @@ import javax.servlet.http.HttpServletResponse;
* request and response.
*
* <p>This interface allows for implementations based on request, session,
* cookies, etc. The default implementation is AcceptHeaderLocaleResolver,
* cookies, etc. The default implementation is
* {@link org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver},
* simply using the request's locale provided by the respective HTTP header.
*
* <p>Use {@code RequestContext.getLocale()} to retrieve the current locale
* in controllers or views, independent of the actual resolution strategy.
* <p>Use {@link org.springframework.web.servlet.support.RequestContext#getLocale()}
* to retrieve the current locale in controllers or views, independent
* of the actual resolution strategy.
*
* @author Juergen Hoeller
* @since 27.02.2003
* @see org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
* @see org.springframework.web.servlet.support.RequestContext#getLocale
*/
public interface LocaleResolver {
/**
* Resolve the current locale via the given request.
* Should return a default locale as fallback in any case.
* Can return a default locale as fallback in any case.
* @param request the request to resolve the locale for
* @return the current locale (never {@code null})
*/
@@ -54,7 +53,7 @@ public interface LocaleResolver {
* @param response the response to be used for locale modification
* @param locale the new locale, or {@code null} to clear the locale
* @throws UnsupportedOperationException if the LocaleResolver implementation
* does not support dynamic changing of the theme
* does not support dynamic changing of the locale
*/
void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,8 @@ import javax.servlet.http.HttpServletResponse;
* request and response.
*
* <p>This interface allows for implementations based on session,
* cookies, etc. The default implementation is FixedThemeResolver,
* cookies, etc. The default implementation is
* {@link org.springframework.web.servlet.theme.FixedThemeResolver},
* simply using a configured default theme.
*
* <p>Note that this resolver is only responsible for determining the
@@ -33,35 +34,34 @@ import javax.servlet.http.HttpServletResponse;
* gets looked up by DispatcherServlet via the respective ThemeSource,
* i.e. the current WebApplicationContext.
*
* <p>Use RequestContext.getTheme() to retrieve the current theme in
* controllers or views, independent of the actual resolution strategy.
* <p>Use {@link org.springframework.web.servlet.support.RequestContext#getTheme()}
* to retrieve the current theme in controllers or views, independent
* of the actual resolution strategy.
*
* @author Jean-Pierre Pawlak
* @author Juergen Hoeller
* @since 17.06.2003
* @see org.springframework.web.servlet.theme.FixedThemeResolver
* @see org.springframework.ui.context.Theme
* @see org.springframework.ui.context.ThemeSource
* @see org.springframework.web.servlet.support.RequestContext#getTheme
*/
public interface ThemeResolver {
/**
* Resolve the current theme name via the given request.
* Should return a default theme as fallback in any case.
* @param request request to be used for resolution
* @return the current theme name
*/
/**
* Resolve the current theme name via the given request.
* Should return a default theme as fallback in any case.
* @param request request to be used for resolution
* @return the current theme name
*/
String resolveThemeName(HttpServletRequest request);
/**
* Set the current theme name to the given one.
* @param request request to be used for theme name modification
* @param response response to be used for theme name modification
* @param themeName the new theme name
/**
* Set the current theme name to the given one.
* @param request request to be used for theme name modification
* @param response response to be used for theme name modification
* @param themeName the new theme name
* @throws UnsupportedOperationException if the ThemeResolver implementation
* does not support dynamic changing of the theme
*/
*/
void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName);
}