Reputation: 577
I have a RestRepositoryResource which is working properly. However, I would prefer to structure URLs using path variables instead of query parameters. The goal would be this:
http://localhost/persons/findByLastName/Smith/
instead of this:
http://localhost/persons/findByLastName?lastName=Smith
I have played around with various annotations but not achieved this using RestRepositoryResource. Is this possible or does this have to be done with a Controller resource mapping?
Upvotes: 0
Views: 728
Reputation: 131
Spring data repositories don't support the @PathVariable annotation right now. However a simple workaround for this problem might be to use URLRewriteFilter internally re-route the request for http://localhost/persons/findByLastName/Smith/
to http://localhost/persons/findByLastName?lastName=Smith
without the user noticing.
Upvotes: 1