- All Implemented Interfaces:
This filter may be used to replace a POST request with a PUT, DELETE or GET request.
Replacement will occur if the request method is POST and there exists either
a request header "X-HTTP-Method-Override", or
a query parameter "_method" with a non-empty value. That value
will be the HTTP method that replaces the POST method. In addition to that,
when replacing the POST method with GET, the filter will convert the form parameters
to query parameters. If the filter is configured to look for both the X-HTTP-Method-Override
header as well as the _method query parameter (the default setting), both are present in the
request and they differ, the filter returns
The filter behavior can be configured using
- Paul Sandoz, Martin Matula, Fredy Nagy, Florian Hars (florian at hars.de)
Nested Class SummaryModifier and TypeClassDescription
static enumEnumeration representing possible sources of information about the method overriding the filter should look for.
Constructor SummaryConstructorDescriptionInitializes this filter setting the sources of information the filter should look for.
HttpMethodOverrideFilterCreate a filter that reads the configuration (
ServerProperties.HTTP_METHOD_OVERRIDE) from the provided
ResourceConfiginstance. This constructor will be called by the Jersey runtime when the filter class is returned from
ResourceConfiginstance will get auto-injected.
rc- ResourceConfig instance that holds the configuration for the filter.
(HttpMethodOverrideFilter.Source... sources)Initializes this filter setting the sources of information the filter should look for.
filterpublic void filter