org.codehaus.groovy.grails.web.mapping.filter
Class UrlMappingsFilter

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.springframework.web.filter.OncePerRequestFilter
          extended by org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter
All Implemented Interfaces:
Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware

public class UrlMappingsFilter
extends OncePerRequestFilter

A Servlet filter that uses the Grails UrlMappings to match and forward requests to a relevant controller and action

Since:
0.5

Created: Mar 6, 2007 Time: 7:58:19 AM

Author:
Graeme Rocher

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
UrlMappingsFilter()
           
 
Method Summary
protected  String buildDispatchUrlForMapping(HttpServletRequest request, UrlMappingInfo info)
          Constructs the URI to forward to using the given request and UrlMappingInfo instance
protected  void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
           
protected  GrailsApplication lookupApplication()
          Looks up the GrailsApplication instance
protected  UrlMappingsHolder lookupUrlMappings()
          Looks up the UrlMappingsHolder instance
 
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, setFilterConfig, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlMappingsFilter

public UrlMappingsFilter()
Method Detail

doFilterInternal

protected void doFilterInternal(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain filterChain)
                         throws ServletException,
                                IOException
Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
ServletException
IOException

buildDispatchUrlForMapping

protected String buildDispatchUrlForMapping(HttpServletRequest request,
                                            UrlMappingInfo info)
Constructs the URI to forward to using the given request and UrlMappingInfo instance

Parameters:
request - The HttpServletRequest
info - The UrlMappingInfo
Returns:
The URI to forward to

lookupUrlMappings

protected UrlMappingsHolder lookupUrlMappings()
Looks up the UrlMappingsHolder instance

Returns:
The UrlMappingsHolder

lookupApplication

protected GrailsApplication lookupApplication()
Looks up the GrailsApplication instance

Returns:
The GrailsApplication instance


Copyright (c) 2005-2006 The Grails project