Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-490

Repository controllers not invoked if resource is handled manually in dedicated media type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2 (Evans SR2), 2.3 RC1 (Fowler)
    • Fix Version/s: 2.3 GA (Fowler)
    • Component/s: None
    • Labels:
      None
    • Sprint:
      56 - Fowler GA

      Description

      I have a Spring Data REST project. For some URLs I want to create a @Controller that renders the resources as HTML. I am using a @RequestMapping with produces = MediaType.TEXT_HTML_VALUE. In fact this controller is called if the URL is requested. However, if I do a request for JSON I get a 406 - while in fact the Spring Data REST controller should be called. I noticed that the log output says that the Spring Data REST controller doesn't register with any value for produces.

      I think a value for produces should be given. Maybe there is a way to do this but I didn't find it in the reference documentation. Maybe there are other ways to get different representations of the REST resources but that doesn't seem to be documented either. I guess different representations for the same resource are an important part of REST so I think there should be a way to do what I want to do.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              eberhardwolff Eberhard Wolff
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: