spring-projects / spring-projects/spring-data-commons
@EnableSpringDataWebSupport and Spring 4.1 mvcUrl JSP tag are difficult to combine [DATACMNS-573]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how @EnableSpringDataWebSupport converts path-variable identifiers and how the Spring 4.1 mvcUrl JSP tag resolves method arguments. Reproduce the ClientController example with mvcUrl('CC#get').arg(0,1).build(). Done means the URL can be generated for an entity identifier without requiring a Client object directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100