org.codehaus.groovy.grails.web.filters
Class HiddenHttpMethodFilter

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

public class HiddenHttpMethodFilter
extends OncePerRequestFilter

Based off the Spring implementation, but this one works with Grails params object and also deals with the X-HTTP-Method-Override HTTP header.

Since:
1.2
Author:
Graeme Rocher
See Also:
HiddenHttpMethodFilter

Field Summary
static String DEFAULT_METHOD_PARAM
          Default method parameter: _method
static String HEADER_X_HTTP_METHOD_OVERRIDE
           
 
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
 
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
 
Constructor Summary
HiddenHttpMethodFilter()
           
 
Method Summary
protected  void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
           
protected  String getHttpMethodOverride(HttpServletRequest request)
           
 void setMethodParam(String methodParam)
          Set the parameter name to look for HTTP methods.
 
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, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_METHOD_PARAM

public static final String DEFAULT_METHOD_PARAM
Default method parameter: _method

See Also:
Constant Field Values

HEADER_X_HTTP_METHOD_OVERRIDE

public static final String HEADER_X_HTTP_METHOD_OVERRIDE
See Also:
Constant Field Values
Constructor Detail

HiddenHttpMethodFilter

public HiddenHttpMethodFilter()
Method Detail

setMethodParam

public void setMethodParam(String methodParam)
Set the parameter name to look for HTTP methods.

See Also:
DEFAULT_METHOD_PARAM

doFilterInternal

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

getHttpMethodOverride

protected String getHttpMethodOverride(HttpServletRequest request)


Copyright (c) 2005-2009 The Grails project