Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-573

@EnableSpringDataWebSupport and Spring 4.1 mvcUrl JSP tag are difficult to combine

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Investigating
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.8.4 (Dijkstra SR4)
    • Fix Version/s: None
    • Component/s: Core

      Description

      @EnableSpringDataWebSupport allows to specify an entity where the browsers sends an entity identifier:

      @Controller
      class ClientController {
        @RequestMapping(value = "/clients/{client}", method = RequestMethod.GET)
        ModelAndView get(@PathVariable Client client) {
        }
      }
      

      accepts a request to /clients/1 and converts 1 to the {8Client}} entity with id 1 by reading this entity from the database.

      You can however not refer to this method with the new mvcUrl JSP tag in Spring 4.1:

      ${s:mvcUrl('CC#get').arg(0,1).build()}
      

      because you feed the first parameter an Integer value 1, which is not compatible with real the type of the parameter Client and mvcUrl does not know about the automatic conversion provided by @EnableSpringDataWebSupport.

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            desmethans Hans Desmet
            Last updater:
            Jens Schauder
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: