Add abstractions for content negotiation

Introduced ContentNeogtiationStrategy for resolving the requested
media types from an incoming request. The available implementations
are based on path extension, request parameter, 'Accept' header,
and a fixed default content type. The logic for these implementations
is based on equivalent options, previously available only in the
ContentNegotiatingViewResolver.

Also in this commit is ContentNegotiationManager, the central class to
use when configuring content negotiation options. It accepts one or
more ContentNeogtiationStrategy instances and delegates to them.

The ContentNeogiationManager can now be used to configure the
following classes:

- RequestMappingHandlerMappingm
- RequestMappingHandlerAdapter
- ExceptionHandlerExceptionResolver
- ContentNegotiatingViewResolver

Issue: SPR-8410, SPR-8417, SPR-8418,SPR-8416, SPR-8419,SPR-7722
This commit is contained in:
Rossen Stoyanchev
2012-06-08 08:56:57 -04:00
parent 35055fd866
commit f05e2bc56f
29 changed files with 1469 additions and 489 deletions

View File

@@ -10,7 +10,7 @@ Changes in version 3.2 M2
* raise RestClientException instead of IllegalArgumentException for unknown status codes
* 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
Changes in version 3.2 M1 (2012-05-28)
--------------------------------------