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

Make it easier to add new Message Converters to AnnotationMethodHandlerAdapter

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.0.4
    • Fix Version/s: 3.1 M1
    • Component/s: Web
    • Labels:
      None

      Description

      See https://support.springsource.com/spring_support_client_getIncidentById/9995

      I needed to use MarshallingHttpMessageConverter (so @RequestBody could bind a POST of XML to a POJO). AnnotationMethodHandlerAdapter is preconfigured in its constructor with several MessagConverters, but not MarshallingHttpMessageConverter. Using the <mvc:annotation-config/> tag, it was nearly impossible to add this MessageConverter to the AMHA. Per Spring Support, I had to write a BeanPostProcessor to look for the AMHA and then add the MTHC (and to add insult to injury, it was an array!).

      There should be a simpler way to add MessageConverters; in fact, if they are found in the application context they should be added automatically, or they should be added via the mvc:annotation-config. Or anything more elegant than the BeanPostProcessor.

      Also section 19.9 of the reference document implies that MarshallingHttpMessageConverter is configured by default, but it's not.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          15d 11h 50m 1 Oliver Gierke 14/Sep/10 6:54 AM
          In Progress In Progress Open Open
          4m 11s 1 Oliver Gierke 14/Sep/10 6:58 AM
          Open Open Resolved Resolved
          133d 3h 26m 1 Rossen Stoyanchev 25/Jan/11 10:25 AM
          Resolved Resolved Closed Closed
          510d 17h 18m 1 Chris Beams 19/Jun/12 3:44 AM

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              kdelong Kenneth DeLong
              Last updater:
              Juergen Hoeller
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 34 weeks ago

                Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h