Top Description Fields Constructors Methods
org.springframework.web.servlet.theme

public Class ThemeChangeInterceptor

extends Object
implements HandlerInterceptor
Class Inheritance
All Implemented Interfaces
org.springframework.web.servlet.HandlerInterceptor
Annotations
@Deprecated
since:6.0
Imports
jakarta.servlet.ServletException, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, org.springframework.web.servlet.HandlerInterceptor, .ThemeResolver, org.springframework.web.servlet.support.RequestContextUtils

Deprecated

since 6.0.

as of 6.0 in favor of using CSS, without direct replacement

Interceptor that allows for changing the current theme on every request, via a configurable request parameter (default parameter name: "theme").
Author
Juergen Hoeller
Since
20.06.2003
See Also
org.springframework.web.servlet.ThemeResolver

Field Summary

Modifier and TypeField and Description
public static final String
DEFAULT_PARAM_NAME

Default name of the theme specification parameter: "theme".

private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getParamName()

Return the name of the parameter that contains a theme specification in a theme change request.

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.springframework.web.servlet.HandlerInterceptor.preHandle.

Interception point before the execution of a handler.

public void
setParamName(String paramName)

Set the name of the parameter that contains a theme specification in a theme change request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_PARAM_NAMEback to summary
public static final String DEFAULT_PARAM_NAME

Default name of the theme specification parameter: "theme".

paramNameback to summary
private String paramName

Constructor Detail

ThemeChangeInterceptorback to summary
public ThemeChangeInterceptor()

Method Detail

getParamNameback to summary
public String getParamName()

Return the name of the parameter that contains a theme specification in a theme change request.

preHandleback to summary
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException

Overrides default org.springframework.web.servlet.HandlerInterceptor.preHandle.

Doc from org.springframework.web.servlet.HandlerInterceptor.preHandle.

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 org.springframework.web.servlet.AsyncHandlerInterceptor.

The default implementation returns true.

Parameters
request:HttpServletRequest

current HTTP request

response:HttpServletResponse

current HTTP response

handler:Object

chosen handler to execute, for type and/or instance evaluation

Returns:boolean

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.

Annotations
@Override
setParamNameback to summary
public void setParamName(String paramName)

Set the name of the parameter that contains a theme specification in a theme change request. Default is "theme".