Spring Framework
  1. Spring Framework
  2. SPR-9570

Proper handling of parameterized types for @RequestBody parameters

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.2 M2
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Issue Links

        Activity

        Hide
        Rossen Stoyanchev added a comment - - edited

        Commit c9b7b132fb0370f51169929b704862b71183b49a:

        This change makes it possible to declare an @RequestBody argument with
        a generic type (e.g. List<Foo>). If a GenericHttpMessageConverter
        implementation supports the method argument, then the request will be
        converted to the apropiate target type.
        
        The new GenericHttpMessageConverter is implemented by the
        MappingJacksonHttpMessageConverter and also by a new
        Jaxb2CollectionHttpMessageConverter that can read read a generic
        Collection where the generic type is a JAXB type annotated with
        @XmlRootElement or @XmlType.
        Show
        Rossen Stoyanchev added a comment - - edited Commit c9b7b132fb0370f51169929b704862b71183b49a : This change makes it possible to declare an @RequestBody argument with a generic type (e.g. List<Foo>). If a GenericHttpMessageConverter implementation supports the method argument, then the request will be converted to the apropiate target type. The new GenericHttpMessageConverter is implemented by the MappingJacksonHttpMessageConverter and also by a new Jaxb2CollectionHttpMessageConverter that can read read a generic Collection where the generic type is a JAXB type annotated with @XmlRootElement or @XmlType.
        Hide
        Frédéric Camblor added a comment -

        Works like a charm without providing any additionnal configuration. Great !

        Show
        Frédéric Camblor added a comment - Works like a charm without providing any additionnal configuration. Great !

          People

          • Assignee:
            Rossen Stoyanchev
            Reporter:
            Rossen Stoyanchev
            Last updater:
            Frédéric Camblor
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 29 weeks, 1 day ago