Details

    • Type: Task
    • Status: Closed
    • Priority: Trivial
    • Resolution: Complete
    • Affects Version/s: 4.1 GA, 4.2 GA
    • Fix Version/s: 4.2.3
    • Component/s: [Documentation], Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Hello

      I know work around

      @RequestMapping(value="something", 
      			    method=RequestMethod.GET,
      			    produces=MediaType.APPLICATION_XML_VALUE)
      

      @RequestMapping(value="something", 
      			    method=RequestMethod.GET,
      			    produces=MediaType.APPLICATION_JSON_VALUE)
      

      It for REST working around the @ResponseBody

      To load a JSP/HTML view my method returns a String to be resolved later through a ViewResolver's implementation

      I am wondered when has sense use:

      • MediaType.TEXT_HTML_VALUE

      Thank you.

        Activity

        Hide
        rstoya05-aop Rossen Stoyanchev added a comment -

        It's there for completeness but you're right to point out it probably won't be used in an @RequestMapping method. That said you could use it anywhere where you want "text/html", could be in tests, or elsewhere like saving a report to a database, etc.

        Show
        rstoya05-aop Rossen Stoyanchev added a comment - It's there for completeness but you're right to point out it probably won't be used in an @RequestMapping method. That said you could use it anywhere where you want "text/html", could be in tests, or elsewhere like saving a report to a database, etc.
        Hide
        dr_pompeii Manuel Jordan added a comment -

        Thanks by the explanation. With the best intention that explanation (perhaps a little more expanded) would added to the reference documentation? It to avoid confusions for the community.

        Show
        dr_pompeii Manuel Jordan added a comment - Thanks by the explanation. With the best intention that explanation (perhaps a little more expanded) would added to the reference documentation? It to avoid confusions for the community.
        Hide
        rstoya05-aop Rossen Stoyanchev added a comment -

        I struggle to see where to the reference documentation and where? We could add Javadoc to the constant. Is that what you meant by reference documentation? If not please clarify as this is a rather fine-grained detail, the kind that's usually not reflected in the reference.

        Show
        rstoya05-aop Rossen Stoyanchev added a comment - I struggle to see where to the reference documentation and where? We could add Javadoc to the constant. Is that what you meant by reference documentation? If not please clarify as this is a rather fine-grained detail, the kind that's usually not reflected in the reference.
        Hide
        dr_pompeii Manuel Jordan added a comment -

        Hello

        I struggle to see where to the reference documentation and where?

        perhaps through a special note when is covered the @RequestMapping's produces attribute. It for Json/xml sections.
        Therefore that note should be added twice.

        We could add Javadoc to the constant

        Yes too.

        Is that what you meant by reference documentation?

        I mean, In Spring Framework I can see Reference and API links, if I do click on Reference I arrive to Spring Framework Reference Documentation

        If not please clarify as this is a rather fine-grained detail, the kind that's usually not reflected in the reference.

        For me, being honest and polite, should be in both places Reference and API. Of course has more sense in API, but seems our perspectives are little different

        Thanks by your support.

        Show
        dr_pompeii Manuel Jordan added a comment - Hello I struggle to see where to the reference documentation and where? perhaps through a special note when is covered the @RequestMapping's produces attribute. It for Json/xml sections. Therefore that note should be added twice. We could add Javadoc to the constant Yes too. Is that what you meant by reference documentation? I mean, In Spring Framework I can see Reference and API links, if I do click on Reference I arrive to Spring Framework Reference Documentation If not please clarify as this is a rather fine-grained detail, the kind that's usually not reflected in the reference. For me, being honest and polite, should be in both places Reference and API. Of course has more sense in API, but seems our perspectives are little different Thanks by your support.

          People

          • Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            dr_pompeii Manuel Jordan
            Last updater:
            St├ęphane Nicoll
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 17 weeks, 4 days ago