public class DeviceResolverHandlerInterceptor extends HandlerInterceptorAdapter
DeviceUtils.CURRENT_DEVICE_ATTRIBUTE
.
Request handlers such as @Controllers and views may then access the currentDevice to vary their control and rendering logic, respectively.Constructor and Description |
---|
DeviceResolverHandlerInterceptor()
Create a device resolving
HandlerInterceptor that defaults to a LiteDeviceResolver implementation. |
DeviceResolverHandlerInterceptor(DeviceResolver deviceResolver)
Create a device resolving
HandlerInterceptor . |
Modifier and Type | Method and Description |
---|---|
boolean |
preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler) |
afterCompletion, afterConcurrentHandlingStarted, postHandle
public DeviceResolverHandlerInterceptor()
HandlerInterceptor
that defaults to a LiteDeviceResolver
implementation.public DeviceResolverHandlerInterceptor(DeviceResolver deviceResolver)
HandlerInterceptor
.deviceResolver
- the device resolver to delegate to in preHandle(HttpServletRequest, HttpServletResponse, Object)
.public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
preHandle
in interface HandlerInterceptor
preHandle
in class HandlerInterceptorAdapter
Exception