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

Explain when to use MediaType constants

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Trivial
    • Resolution: Complete
    • 4.1 GA, 4.2 GA
    • 4.2.3
    • [Documentation], Web
    • None
    • 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.

      Attachments

        Activity

          People

            rstoya05-aop Rossen Stoyanchev
            dr_pompeii Manuel Jordan
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 47 weeks, 2 days ago