public class DeviceResolverHandlerInterceptor
extends org.springframework.web.servlet.handler.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(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler) |
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(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
throws java.lang.Exception
preHandle in interface org.springframework.web.servlet.HandlerInterceptorpreHandle in class org.springframework.web.servlet.handler.HandlerInterceptorAdapterjava.lang.Exception