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

Explicitly set response Content-Type in @ResponseBody

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.1 M2
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      It would be useful to override the default content-type written by the HttpMessageConverters in the @ResponseBody annotation. Something like:

      @ResponseBody("foo/bar")
      public String myHandlerMethod() {
        return "myFooBar";
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                arjen.poutsma Arjen Poutsma
                Last updater:
                Trevor Marshall
              • Votes:
                10 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 15 weeks, 1 day ago