Skip to content

@EnableSpringDataWebSupport and Spring 4.1 mvcUrl JSP tag are difficult to combine [DATACMNS-573] #1040

Open
@spring-projects-issues

Description

@spring-projects-issues

Hans Desmet opened DATACMNS-573 and commented

@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.


Affects: 1.8.4 (Dijkstra SR4)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions