This commit also includes lazy resolution support for StandardServletMultipartResolver, along the lines of existing lazy mode in CommonsMultipartResolver.
Issue: SPR-11074
Issue: SPR-11730
This feature required support for response exposure on Servlet/PortletRequestAttributes, instead of just in the Servlet/PortletWebRequest subclasses.
Issue: SPR-11795
Spring MVC now supports Jackon's serialization views for rendering
different subsets of the same POJO from different controller
methods (e.g. detailed page vs summary view).
Issue: SPR-7156
This change adds a strategy for assigning a default name to an
@RequestMapping controller method. The @RequestMapping annotation
itself now has a name attribute allowing the explicit assignment
of a mapping name.
This is mainly intended for use in EL expressions in views. The
RequestContext class now provides a getMvcUrl method that internally
delegates to MvcUriComponents to look up the handler method.
See the Javadoc of MvcUriComponents.fromMappingName.
Issue: SPR-5779
This change refines the logic of "mapping" content negotiation
strategies with regards to how to handle cases where no mapping is
found.
The request parameter strategy now treats request parameter values that
do not match any mapped media type as 406 errors.
The path extension strategy provides a new flag called
"ignoreUnknownExtensions" (true by default) that when set to false also
results in a 406. The same flag is also exposed through the
ContentNegotiationManagerFactoryBean and the MVC Java config.
Issue: SPR-10170
Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.
This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.
The verification process can be invoked by running the 'sniff'
task.
Issue: SPR-11604
polishing
Clean up compiler warnings in the tests of spring-web. This commit
adds type parameters to all the types (mostly `List` and `Map`).
After this commit the only warnings in spring-web left are in
* `MockExpressionEvaluator` this can't be fixed until JSP-EL is fixed
* `Jackson2ObjectMapperFactoryBeanTests#testSetModules` that code
would never compile with generics.
This commit rationalizes the use of @Order so that the standard
@Priority annotation can be used instead. The handling of both
annotations are now defined in OrderUtils.
This also updates the link to the JavaEE API so that we refer to
JavaEE7 instead of JavaEE6.
Issue: SPR-11639
Prior to this commit, the ShallowEtagHeaderFilter did not use the
content length given by the content generator to set the
ByteArrayOutputStream's buffer size.
This can lead to performance issues for large content since the buffer
grows as the content is being written.
This commit adds a new ByteArrayOutputStream variant called
ResizableByteArrayOutputStream. This implementation has public methods
for modifying the internal buffer size and does not synchronize on
buffer access.
This commit also make use of this new variant in
ShallowEtagHeaderFilter.
Issue: SPR-8271
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.
In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.
The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
Since HttpClient 4.3, custom configuration such as the connection
timeout and the socket timeout are set in a RequestConfig object
stored in the HttpContext.
Unfortunately, older HttpClients are not supporting this
infrastructure and new clients throw an exception when the
deprecated API is used.
This commit detects if the client is an "old" implementation and
set the configuration through the deprecated means to restore
full backward compatibility with these features.
Issue: SPR-11442
After this change, AbstractSockJsService does not add CORS headers if
the response already contains an "Access-Control-Allow-Origin" header.
Essentially it backs off assuming CORS headers are handled centrally
e.g. through a Filter.
In order to support this, the ServletServerHttpResponse now returns an
instance of HttpHeaders that also provides access to headers already
present in the HttpServletResponse.
Issue: SPR-11443
- Deleted empty AbstractWebSocketClientTests class.
- AbstractServletHandlerMethodTests and AbstractHttpRequestTests are
now actually declared as abstract.
- The following classes are not abstract but currently have an
"Abstract" prefix and therefore get ignored by the Gradle build.
This commit renames each of these by deleting the "Abstract" prefix.
- AbstractFlashMapManagerTests
- AbstractMappingContentNegotiationStrategyTests
- AbstractSockJsServiceTests
- AbstractWebSocketHandlerRegistrationTests
Allow Jaxb2RootElementHttpMessageConverter subclasses to customize
the {@link Marshaller} and the {@link Unmarshaller} created by the
message converter.
Issue: SPR-11488