Package org.grails.web.filters
Class HiddenHttpMethodFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.web.filter.OncePerRequestFilter
-
- org.grails.web.filters.HiddenHttpMethodFilter
-
- 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.core.env.EnvironmentCapable
,org.springframework.web.context.ServletContextAware
public class HiddenHttpMethodFilter extends org.springframework.web.filter.OncePerRequestFilter
Based off the Spring implementation, but also supports the X-HTTP-Method-Override HTTP header.- Since:
- 1.2
- See Also:
HiddenHttpMethodFilter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
HiddenHttpMethodFilter.HttpMethodRequestWrapper
SimpleHttpServletRequest
wrapper that returns the supplied method forHttpServletRequest.getMethod()
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_METHOD_PARAM
Default method parameter:_method
static java.lang.String
HEADER_X_HTTP_METHOD_OVERRIDE
-
Constructor Summary
Constructors Constructor Description HiddenHttpMethodFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
protected java.lang.String
getHttpMethodOverride(javax.servlet.http.HttpServletRequest request)
void
setMethodParam(java.lang.String methodParam)
Set the parameter name to look for HTTP methods.-
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
-
-
-
-
Field Detail
-
DEFAULT_METHOD_PARAM
public static final java.lang.String DEFAULT_METHOD_PARAM
Default method parameter:_method
- See Also:
- Constant Field Values
-
HEADER_X_HTTP_METHOD_OVERRIDE
public static final java.lang.String HEADER_X_HTTP_METHOD_OVERRIDE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setMethodParam
public void setMethodParam(java.lang.String methodParam)
Set the parameter name to look for HTTP methods.- See Also:
DEFAULT_METHOD_PARAM
-
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 classorg.springframework.web.filter.OncePerRequestFilter
- Throws:
javax.servlet.ServletException
java.io.IOException
-
getHttpMethodOverride
protected java.lang.String getHttpMethodOverride(javax.servlet.http.HttpServletRequest request)
-
-