SPR-7353 - Added equivalent of JAX-RS @Produces to Spring MVC

This commit is contained in:
Arjen Poutsma
2011-05-13 09:43:45 +00:00
parent a557878a6f
commit bb2cc8457f
11 changed files with 702 additions and 131 deletions

View File

@@ -311,4 +311,17 @@ public @interface RequestMapping {
*/
String[] consumes() default "*/*";
/**
* The producible media types of the mapped request, narrowing the primary mapping.
* <p>The format is a sequence of media types ("text/plain", "application/*),
* with a request only mapped if the {@code Accept} matches one of these media types.
* Expressions can be negated by using the "!" operator, as in "!text/plain", which matches
* all requests with a {@code Accept} other than "text/plain".
* <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 override
* this consumes restriction.
* @see org.springframework.http.MediaType
*/
String[] produces() default "*/*";
}