SPR-10402 in Spring Framework 3.2.3 treated empty request parameter
values as missing values, if the empty value was turned into a null
by a PropertyEditor or Converter. This caused the regression.
Issue: SPR-10578, SPR-10402, SPR-10584
Similar to @ExceptionHandler but for message processing. Such a method
can send messages to both the message broker channel and the client
channel provided the client is subscribed to the target destination.
Prior to this commit the Spring Framework did not provide a public means
for scanning for available server ports. However, the Spring Framework
internally used a FreePortScanner in integration tests within its own
test suite. Furthermore, Spring Integration 2.2 provides similar support
in a SocketUtils class in the spring-integration-test module.
This commit introduces SocketUtils in spring-core to replace the
FreePortScanner which was previously only used internally within
Spring's test suite. This new implementation is inspired by both Spring
Framework's FreePortScanner and Spring Integration's SocketUtils and
consequently attempts to merge the best of both previous
implementations.
Issue: SPR-8032
Previously DeferredResult locked around the setting of the result
including handling up to the part of submitting a dispatch. This
can cause a deadlock if a timeout occurs at the same time since
the Tomcat timeout thread has its own locking that permits only
one thread to do timeout or dispatch processing.
The fix reduces the locking to cover only the attempt to set the
DeferredResult but not the dispatching.
Issue: SPR-10485
Spring 3.2.2 introduced a change to avoid closing the response stream
in HttpMessageConverters (SPR-10095). However, the InputStream of
resources being written, for example as part of a multi-part request
should be closed. This change ensures that.
Issue: SPR-10460
If type conversion turns an empty request parameter value (i.e. "") to
null, we should treat it as a missing value. By default the
ConversionService doesn't change empty strings and therefore one must
explicitly convert them to null for example by registering a
StringTrimmerEditor with emptyAsNull=true.
Issue: SPR-10402
Previously ContentNegotiationManager continued with the next
ContentNegotiationStrategy only if the current one returned an empty
list. Now it also does that if the current ContentNegotiationStrategy
returns "*/*". Since the absence of an Accept header and "*/*" have
the same meaning, this allows a default content type to be used in
either case.
Issue: SPR-10513
Update ServletContextAwareProcessor to allow subclasses to support late
binding of the ServletConfig and/or ServletContext. Allows for the
post-processor to be registered before the servlet environment has been
initialized.
Issue: SPR-10381
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.
Issue: SPR-9639
This is useful to make sure response headers are written to the
underlying response. It is also useful in conjunction with long
running, async requests and HTTP streaming, to ensure the Servlet
response buffer is sent to the client without additional delay and
also causes an IOException to be raised if the client has gone away.
- configure SockJS handler by type (as well as by instance)
- add method to obtain SockJS handler instance via SockJsConfiguration
- detect presense of jsr-356 and use it if available
Previously the methodParameter array field was initialized lazily since
it requires reflection. However, in practice the field is always used
and there is not much benefit from the lazy initialization.
In Spring Framework 3.2, the methodParameter field was copied when a
new HandlerMethod instance (with the resolved bean) is created for
performance reasons. That introduced a synchronization issue since
the lazy initialization was not synchronized.
Issue: SPR-10365
Check for an empty fragment in UriComponentsBuilder.fromUriString(...)
to prevent the invocation of fragment(...).
Previously, UriComponentsBuilder.fromUriString(...) threw an exception
in the case of an empty fragment being provided (e.g. /example#).
Issue: SPR-10363
MockServletContext.getMimeTypes now returns null if the Java Activation
Framework returns "application/octet-stream", which is the default
media type it returns if the mime type is unknown. This enforces the
contract for ServletContext.getMimeTypes (return null for uknown mime
types) but does mean "application/octet-stream" cannot be returned.
Issue: SPR-10334
Deprecate HttpStatus.MOVED_TEMPORARILY in favor of HttpStatus.FOUND
since HttpStatus.valueOf(302) will always return FOUND.
The name of the 302 status code was changed between HTTP 1.0 and
HTTP 1.1 but the underlying meaning remains the same.
Issue: SPR-10300