Add support for HTTP PATCH method
The HTTP PATCH method is now supported whereever HTTP methods are used. Annotated controllers can be mapped to RequestMethod.PATCH. On the client side the RestTemplate execute(..) and exchange(..) methods can be used with HttpMethod.PATCH. In terms of HTTP client libraries, Apache HttpComponents HttpClient version 4.2 or later is required (see HTTPCLIENT-1191). The JDK HttpURLConnection does not support the HTTP PATCH method. Issue: SPR-7985
This commit is contained in:
parent
f05e2bc56f
commit
a0747458e7
|
|
@ -360,7 +360,7 @@ project('spring-web') {
|
|||
compile("commons-fileupload:commons-fileupload:1.2", optional)
|
||||
runtime("commons-io:commons-io:1.3", optional)
|
||||
compile("commons-httpclient:commons-httpclient:3.1", optional)
|
||||
compile("org.apache.httpcomponents:httpclient:4.1.1", optional)
|
||||
compile("org.apache.httpcomponents:httpclient:4.2", optional)
|
||||
compile("org.codehaus.jackson:jackson-mapper-asl:1.4.2", optional)
|
||||
compile("com.fasterxml.jackson.core:jackson-databind:2.0.1", optional)
|
||||
compile("taglibs:standard:1.1.2", optional)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -26,6 +26,6 @@ package org.springframework.http;
|
|||
*/
|
||||
public enum HttpMethod {
|
||||
|
||||
GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE
|
||||
GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -141,6 +141,9 @@ public class CommonsClientHttpRequestFactory implements ClientHttpRequestFactory
|
|||
return new PutMethod(uri);
|
||||
case TRACE:
|
||||
return new TraceMethod(uri);
|
||||
case PATCH:
|
||||
throw new IllegalArgumentException(
|
||||
"HTTP method PATCH not available before Apache HttpComponents HttpClient 4.2");
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid HTTP method: " + httpMethod);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -17,12 +17,9 @@
|
|||
package org.springframework.http.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.URI;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpDelete;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
|
|
@ -40,6 +37,10 @@ import org.apache.http.impl.client.DefaultHttpClient;
|
|||
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
|
||||
import org.apache.http.params.CoreConnectionPNames;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.http.client.ClientHttpRequestFactory} implementation that uses
|
||||
|
|
@ -155,11 +156,30 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|||
return new HttpPut(uri);
|
||||
case TRACE:
|
||||
return new HttpTrace(uri);
|
||||
case PATCH:
|
||||
return createHttpPatch(uri);
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid HTTP method: " + httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpUriRequest createHttpPatch(URI uri) {
|
||||
String className = "org.apache.http.client.methods.HttpPatch";
|
||||
ClassLoader classloader = this.getClass().getClassLoader();
|
||||
if (!ClassUtils.isPresent(className, classloader)) {
|
||||
throw new IllegalArgumentException(
|
||||
"HTTP method PATCH not available before Apache HttpComponents HttpClient 4.2");
|
||||
}
|
||||
try {
|
||||
Class<?> clazz = classloader.loadClass(className);
|
||||
Constructor<?> constructor = clazz.getConstructor(URI.class);
|
||||
return (HttpUriRequest) constructor.newInstance(uri);
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
throw new IllegalStateException("Unable to instantiate " + className, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Template method that allows for manipulating the {@link HttpUriRequest} before it is
|
||||
* returned as part of a {@link HttpComponentsClientHttpRequest}.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -152,7 +152,7 @@ public class SimpleClientHttpRequestFactory implements ClientHttpRequestFactory
|
|||
else {
|
||||
connection.setInstanceFollowRedirects(false);
|
||||
}
|
||||
if ("PUT".equals(httpMethod) || "POST".equals(httpMethod)) {
|
||||
if ("PUT".equals(httpMethod) || "POST".equals(httpMethod) || "PATCH".equals(httpMethod)) {
|
||||
connection.setDoOutput(true);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
import org.springframework.http.MediaType;
|
||||
|
||||
/**
|
||||
* Exception thrown when a client POSTs or PUTs content
|
||||
* Exception thrown when a client POSTs, PUTs, or PATCHes content of a type
|
||||
* not supported by request handler.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ public @interface RequestMapping {
|
|||
|
||||
/**
|
||||
* The HTTP request methods to map to, narrowing the primary mapping:
|
||||
* GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE.
|
||||
* GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE.
|
||||
* <p><b>Supported at the type level as well as at the method level!</b>
|
||||
* When used at the type level, all method-level mappings inherit
|
||||
* this HTTP method restriction (i.e. the type-level restriction
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -22,7 +22,7 @@ package org.springframework.web.bind.annotation;
|
|||
* {@link RequestMapping} annotation.
|
||||
*
|
||||
* <p>Note that, by default, {@link org.springframework.web.servlet.DispatcherServlet}
|
||||
* supports GET, HEAD, POST, PUT and DELETE only. DispatcherServlet will
|
||||
* supports GET, HEAD, POST, PUT, PATCH and DELETE only. DispatcherServlet will
|
||||
* process TRACE and OPTIONS with the default HttpServlet behavior unless
|
||||
* explicitly told to dispatch those request types as well: Check out
|
||||
* the "dispatchOptionsRequest" and "dispatchTraceRequest" properties,
|
||||
|
|
@ -36,6 +36,6 @@ package org.springframework.web.bind.annotation;
|
|||
*/
|
||||
public enum RequestMethod {
|
||||
|
||||
GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE
|
||||
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -46,12 +46,12 @@ import org.springframework.util.MultiValueMap;
|
|||
/**
|
||||
* {@link javax.servlet.Filter} that makes form encoded data available through
|
||||
* the {@code ServletRequest.getParameter*()} family of methods during HTTP PUT
|
||||
* requests.
|
||||
* or PATCH requests.
|
||||
*
|
||||
* <p>The Servlet spec requires form data to be available for HTTP POST but
|
||||
* not for HTTP PUT requests. This filter intercepts HTTP PUT requests where
|
||||
* content type is {@code 'application/x-www-form-urlencoded'}, reads form
|
||||
* encoded content from the body of the request, and wraps the ServletRequest
|
||||
* not for HTTP PUT or PATCH requests. This filter intercepts HTTP PUT and PATCH
|
||||
* requests where content type is {@code 'application/x-www-form-urlencoded'},
|
||||
* reads form encoded content from the body of the request, and wraps the ServletRequest
|
||||
* in order to make the form data available as request parameters just like
|
||||
* it is for HTTP POST requests.
|
||||
*
|
||||
|
|
@ -73,7 +73,7 @@ public class HttpPutFormContentFilter extends OncePerRequestFilter {
|
|||
protected void doFilterInternal(final HttpServletRequest request, HttpServletResponse response,
|
||||
FilterChain filterChain) throws ServletException, IOException {
|
||||
|
||||
if ("PUT".equals(request.getMethod()) && isFormContentType(request)) {
|
||||
if (("PUT".equals(request.getMethod()) || "PATCH".equals(request.getMethod())) && isFormContentType(request)) {
|
||||
HttpInputMessage inputMessage = new ServletServerHttpRequest(request) {
|
||||
@Override
|
||||
public InputStream getBody() throws IOException {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -68,6 +68,7 @@ public abstract class AbstractHttpRequestFactoryTestCase {
|
|||
jettyContext.addServlet(new ServletHolder(new MethodServlet("OPTIONS")), "/methods/options");
|
||||
jettyContext.addServlet(new ServletHolder(new PostServlet()), "/methods/post");
|
||||
jettyContext.addServlet(new ServletHolder(new MethodServlet("PUT")), "/methods/put");
|
||||
jettyContext.addServlet(new ServletHolder(new MethodServlet("PATCH")), "/methods/patch");
|
||||
jettyServer.start();
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +161,7 @@ public abstract class AbstractHttpRequestFactoryTestCase {
|
|||
assertHttpMethod("delete", HttpMethod.DELETE);
|
||||
}
|
||||
|
||||
private void assertHttpMethod(String path, HttpMethod method) throws Exception {
|
||||
protected void assertHttpMethod(String path, HttpMethod method) throws Exception {
|
||||
ClientHttpResponse response = null;
|
||||
try {
|
||||
ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/methods/" + path), method);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -16,10 +16,26 @@
|
|||
|
||||
package org.springframework.http.client;
|
||||
|
||||
import java.net.ProtocolException;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
public class BufferedSimpleHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase {
|
||||
|
||||
@Override
|
||||
protected ClientHttpRequestFactory createRequestFactory() {
|
||||
return new SimpleClientHttpRequestFactory();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void httpMethods() throws Exception {
|
||||
try {
|
||||
assertHttpMethod("patch", HttpMethod.PATCH);
|
||||
}
|
||||
catch (ProtocolException ex) {
|
||||
// Currently HttpURLConnection does not support HTTP PATCH
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -16,9 +16,10 @@
|
|||
|
||||
package org.springframework.http.client;
|
||||
|
||||
import org.springframework.http.client.AbstractHttpRequestFactoryTestCase;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.CommonsClientHttpRequestFactory;
|
||||
import java.net.URI;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
public class CommonsHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase {
|
||||
|
||||
|
|
@ -26,4 +27,10 @@ public class CommonsHttpRequestFactoryTests extends AbstractHttpRequestFactoryTe
|
|||
protected ClientHttpRequestFactory createRequestFactory() {
|
||||
return new CommonsClientHttpRequestFactory();
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void httpPatch() throws Exception {
|
||||
factory.createRequest(new URI(baseUrl + "/methods/PATCH"), HttpMethod.PATCH);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -16,10 +16,19 @@
|
|||
|
||||
package org.springframework.http.client;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
public class HttpComponentsClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase {
|
||||
|
||||
@Override
|
||||
protected ClientHttpRequestFactory createRequestFactory() {
|
||||
return new HttpComponentsClientHttpRequestFactory();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void httpMethods() throws Exception {
|
||||
assertHttpMethod("patch", HttpMethod.PATCH);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -29,6 +29,7 @@ import java.util.Map;
|
|||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.mock.web.MockFilterChain;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
|
@ -59,16 +60,20 @@ public class HttpPutFormContentFilterTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void wrapPutOnly() throws Exception {
|
||||
public void wrapPutAndPatchOnly() throws Exception {
|
||||
request.setContent("".getBytes("ISO-8859-1"));
|
||||
String[] methods = new String[] {"GET", "POST", "DELETE", "HEAD", "OPTIONS", "TRACE"};
|
||||
for (String method : methods) {
|
||||
request.setMethod(method);
|
||||
for (HttpMethod method : HttpMethod.values()) {
|
||||
request.setMethod(method.name());
|
||||
filterChain = new MockFilterChain();
|
||||
filter.doFilter(request, response, filterChain);
|
||||
if (method.equals(HttpMethod.PUT) || method.equals(HttpMethod.PATCH)) {
|
||||
assertNotSame("Should wrap HTTP method " + method, request, filterChain.getRequest());
|
||||
}
|
||||
else {
|
||||
assertSame("Should not wrap for HTTP method " + method, request, filterChain.getRequest());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void wrapFormEncodedOnly() throws Exception {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
|||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.context.ConfigurableWebApplicationContext;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
|
|
@ -767,6 +768,25 @@ public abstract class FrameworkServlet extends HttpServletBean {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Override the parent class implementation in order to intercept PATCH
|
||||
* requests.
|
||||
*
|
||||
* @see #doPatch(HttpServletRequest, HttpServletResponse)
|
||||
*/
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
String method = request.getMethod();
|
||||
if (method.equalsIgnoreCase(RequestMethod.PATCH.name())) {
|
||||
doPatch(request, response);
|
||||
}
|
||||
else {
|
||||
super.service(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegate GET requests to processRequest/doService.
|
||||
* <p>Will also be invoked by HttpServlet's default implementation of <code>doHead</code>,
|
||||
|
|
@ -803,6 +823,16 @@ public abstract class FrameworkServlet extends HttpServletBean {
|
|||
processRequest(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegate PATCH requests to {@link #processRequest}.
|
||||
* @see #doService
|
||||
*/
|
||||
protected final void doPatch(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
processRequest(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegate DELETE requests to {@link #processRequest}.
|
||||
* @see #doService
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -813,6 +813,21 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
assertEquals(requestBody, response.getContentAsString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void httpPatch() throws ServletException, IOException {
|
||||
initServletWithControllers(RequestResponseBodyController.class);
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("PATCH", "/something");
|
||||
String requestBody = "Hello world!";
|
||||
request.setContent(requestBody.getBytes("UTF-8"));
|
||||
request.addHeader("Content-Type", "text/plain; charset=utf-8");
|
||||
request.addHeader("Accept", "text/*, */*");
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
getServlet().service(request, response);
|
||||
assertEquals(200, response.getStatus());
|
||||
assertEquals(requestBody, response.getContentAsString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void responseBodyNoAcceptableMediaType() throws ServletException, IOException {
|
||||
initServlet(new ApplicationContextInitializer<GenericWebApplicationContext>() {
|
||||
|
|
@ -2335,6 +2350,12 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
|||
public String handle(@RequestBody String body) throws IOException {
|
||||
return body;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/something", method = RequestMethod.PATCH)
|
||||
@ResponseBody
|
||||
public String handlePartialUpdate(@RequestBody String content) throws IOException {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
@Controller
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ Changes in version 3.2 M2
|
|||
* add JacksonObjectMapperFactoryBean for configuring a Jackson ObjectMapper in XML
|
||||
* infer return type of parameterized factory methods (SPR-9493)
|
||||
* add ContentNegotiationManager/ContentNegotiationStrategy to resolve requested media types
|
||||
* add support for the HTTP PATCH method
|
||||
|
||||
Changes in version 3.2 M1 (2012-05-28)
|
||||
--------------------------------------
|
||||
|
|
|
|||
|
|
@ -1975,7 +1975,7 @@ public class EditPetForm {
|
|||
<literal>ServletRequest.getParameter*()</literal> family of methods to
|
||||
support form field access only for HTTP POST, not for HTTP PUT.</para>
|
||||
|
||||
<para>To support HTTP PUT requests, the <literal>spring-web</literal>
|
||||
<para>To support HTTP PUT and PATCH requests, the <literal>spring-web</literal>
|
||||
module provides the filter
|
||||
<classname>HttpPutFormContentFilter</classname>, which can be
|
||||
configured in <filename>web.xml</filename>:</para>
|
||||
|
|
@ -1995,7 +1995,7 @@ public class EditPetForm {
|
|||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
</servlet></programlisting>
|
||||
|
||||
<para>The above filter intercepts HTTP PUT requests with content type
|
||||
<para>The above filter intercepts HTTP PUT and PATCH requests with content type
|
||||
<literal>application/x-www-form-urlencoded</literal>, reads the form
|
||||
data from the body of the request, and wraps the
|
||||
<classname>ServletRequest</classname> in order to make the form data
|
||||
|
|
|
|||
Loading…
Reference in New Issue