Tuesday, June 21, 2011

Spring 3.1 M2: Spring MVC Enhancements

Programming Model Improvements

This is the list of programming model improvements introduced in the new @MVC support classes.
  1. Declared @PathVariable arguments are now automatically added to the model. For example this:

  2. is replaced by:


  3. Redirect strings support URI templates expanded with variables from the model (including declared @PathVariables). For example this:

  4. is replaced by:


  5. URI template variables are supported in data binding. For example this:

  6. is replaced by:


  7. Consumable and producible media types can be specified via @RequestMapping. For example this:

  8. is replaced by:

    Besides being shorter the above returns NOT_ACCEPTABLE (406) if the URL matches but the input media type doesn't.

  9. For producible media types this:

  10. is replaced by:

    The above returns a NOT_SUPPORTED_MEDIA_TYPE (415) if the URL matches but the acceptable media type doesn't.

No comments:

Post a Comment