Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-8381

HttpMessageConverter doesn't support typed collections

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.2 M2
    • Component/s: Web
    • Labels:
      None

      Description

      HttpMessageConverter can't support conversion to typed collections.

      Example: Use JacksonJsonMessageConverter to convert a json string to a Collection<Pojo> objects.

      Since only a Class<? extends T> is specified, there's no way to declare both the type (Pojo.class) and the object (Collection.class).

      Jackson classes support this using a TypeReference class (see: http://wiki.fasterxml.com/JacksonInFiveMinutes#Data_Binding_with_Generics)

      Also, MappingJacksonJsonMessageConverter (line 104) is using a deprecated method of the current release of Jackson.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                davidparks21 David Parks
                Last updater:
                Juergen Hoeller
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 40 weeks, 3 days ago