spring-mobile-device

org.springframework.mobile.device
Class DeviceResolverRequestFilter

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.springframework.web.filter.OncePerRequestFilter
          extended by org.springframework.mobile.device.DeviceResolverRequestFilter
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.web.context.ServletContextAware

public class DeviceResolverRequestFilter
extends org.springframework.web.filter.OncePerRequestFilter

A Servlet 2.3 Filter that resolves the Device that originated the web request. The resolved Device is exported as a request attribute under the well-known name of DeviceUtils.CURRENT_DEVICE_ATTRIBUTE. Request handlers such as @Controllers and views may then access the currentDevice to vary their control and rendering logic, respectively.

Author:
Roy Clarkson

Field Summary
 
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
 
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
 
Constructor Summary
DeviceResolverRequestFilter()
          Create a device resolving Filter that defaults to a LiteDeviceResolver implementation.
DeviceResolverRequestFilter(DeviceResolver deviceResolver)
          Create a device resolving Filter.
 
Method Summary
protected  void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
           
 
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
 
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceResolverRequestFilter

public DeviceResolverRequestFilter()
Create a device resolving Filter that defaults to a LiteDeviceResolver implementation.


DeviceResolverRequestFilter

public DeviceResolverRequestFilter(DeviceResolver deviceResolver)
Create a device resolving Filter.

Parameters:
deviceResolver - the device resolver to delegate to.
Method Detail

doFilterInternal

protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.FilterChain filterChain)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Specified by:
doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
Throws:
javax.servlet.ServletException
java.io.IOException

spring-mobile-device