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

Explicitly set response Content-Type in @ResponseBody

    XMLWordPrintable

    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:
      true

      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:
              Spring Issuemaster
              Votes:
              10 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 20 weeks, 3 days ago