Open spring-projects-issues opened 10 years ago
Oliver Drotbohm commented
What's the reason you don't hand a Client
instance to the arg(…)
method? That wouldn't require a conversion at all then, would it?
Rossen Stoyanchev - Does the mvcUrl
tag not consider the ConversionService
for potentially matching conversions? That's the way we integrate on actual requests with MVC so I would've expected a similar binding to happen for the JSP tag usage
Rossen Stoyanchev commented
Currently we don't. I suppose we could try to hook that in
Hans Desmet commented
Hello Oliver,
I created a litte sample project that uses your suggestion: hand a Client instance to the arg(...) method. You can clone it from https://github.com/desmethans/mvcurl.git It leads to a java.lang.IllegalArgumentException: The source to convert from must be an instance of long; instead it was a be.vdab.entities.Client. Hope it helps to understand and solve the problem
Hans Desmet opened DATACMNS-573 and commented
@EnableSpringDataWebSupport
allows to specify an entity where the browsers sends an entity identifier: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:because you feed the first parameter an
Integer
value 1, which is not compatible with real the type of the parameterClient
andmvcUrl
does not know about the automatic conversion provided by@EnableSpringDataWebSupport
.Affects: 1.8.4 (Dijkstra SR4)