类 ThemeChangeInterceptor
- java.lang.Object
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
- org.springframework.web.servlet.theme.ThemeChangeInterceptor
- 所有已实现的接口:
AsyncHandlerInterceptor
,HandlerInterceptor
public class ThemeChangeInterceptor extends HandlerInterceptorAdapter
Interceptor that allows for changing the current theme on every request, via a configurable request parameter (default parameter name: "theme").- 从以下版本开始:
- 20.06.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
ThemeResolver
字段概要
字段 修饰符和类型 字段 说明 static String
DEFAULT_PARAM_NAME
Default name of the theme specification parameter: "theme".
构造器概要
构造器 构造器 说明 ThemeChangeInterceptor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getParamName()
Return the name of the parameter that contains a theme specification in a theme change request.boolean
preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation always returnstrue
.void
setParamName(String paramName)
Set the name of the parameter that contains a theme specification in a theme change request.从类继承的方法 org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, afterConcurrentHandlingStarted, postHandle
字段详细资料
DEFAULT_PARAM_NAME
public static final String DEFAULT_PARAM_NAME
Default name of the theme specification parameter: "theme".- 另请参阅:
- 常量字段值
构造器详细资料
ThemeChangeInterceptor
public ThemeChangeInterceptor()
方法详细资料
setParamName
public void setParamName(String paramName)
Set the name of the parameter that contains a theme specification in a theme change request. Default is "theme".
getParamName
public String getParamName()
Return the name of the parameter that contains a theme specification in a theme change request.
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException
从类复制的说明:HandlerInterceptorAdapter
This implementation always returnstrue
.- 指定者:
preHandle
在接口中HandlerInterceptor
- 覆盖:
preHandle
在类中HandlerInterceptorAdapter
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- chosen handler to execute, for type and/or instance evaluation- 返回:
true
if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.- 抛出:
ServletException