Comprehensive Servlet 3.1 support in spring-web and spring-test

Issue: SPR-14467
This commit is contained in:
Juergen Hoeller
2016-07-15 22:11:14 +02:00
parent 177f4ec3a7
commit f0c397e4e2
14 changed files with 107 additions and 72 deletions

View File

@@ -42,6 +42,9 @@ import org.springframework.web.util.WebUtils;
* (e.g. a {@link org.springframework.web.servlet.View}) is still rendered.
* As such, this filter only saves bandwidth, not server performance.
*
* <p><b>NOTE:</b> As of Spring Framework 5.0, this filter uses request/response
* decorators built on the Servlet 3.1 API.
*
* @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Juergen Hoeller

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -39,6 +39,7 @@ import org.springframework.http.HttpMethod;
* and allows this content to be retrieved via a {@link #getContentAsByteArray() byte array}.
*
* <p>Used e.g. by {@link org.springframework.web.filter.AbstractRequestLoggingFilter}.
* Note: As of Spring Framework 5.0, this wrapper is built on the Servlet 3.1 API.
*
* @author Juergen Hoeller
* @author Brian Clozel
@@ -166,7 +167,6 @@ public class ContentCachingRequestWrapper extends HttpServletRequestWrapper {
return this.cachedContent.toByteArray();
}
// TODO: this is no longer usable in Servlet 3.0 environment
private class ContentCachingInputStream extends ServletInputStream {
@@ -197,7 +197,7 @@ public class ContentCachingRequestWrapper extends HttpServletRequestWrapper {
@Override
public void setReadListener(ReadListener readListener) {
this.setReadListener(readListener);
this.is.setReadListener(readListener);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -34,6 +34,7 @@ import org.springframework.util.FastByteArrayOutputStream;
* and allows this content to be retrieved via a {@link #getContentAsByteArray() byte array}.
*
* <p>Used e.g. by {@link org.springframework.web.filter.ShallowEtagHeaderFilter}.
* Note: As of Spring Framework 5.0, this wrapper is built on the Servlet 3.1 API.
*
* @author Juergen Hoeller
* @since 4.1.3
@@ -228,7 +229,6 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper {
}
}
// TODO: this is no longer usable in Servlet 3.0 environment
private class ResponseServletOutputStream extends ServletOutputStream {