-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Rich Kroll opened SPR-6486 and commented
I have a URI template in the form of "/hotels/{hotel}/bookings/{booking}", and can access the path variables in the controller via @PathVariable
, but when building links in the view I need a reference to the different path variables.
As an example, let's say the user requests "/hotels/Hotelier/bookings/booking-123", and as is a common use case in the view, there is a need to link back to the bookings listing "/hotels/Hotelier/bookings/". The only way currently to access the URI template variables is to manually inject them each time into the view. I suggest that a tag be created that is capable of building a link from the same URI template style that is used in the @RequestMapping
, something like <spring:a link="/hotels/{hotel}">go</spring:a>.
Affects: 3.0 M1, 3.0 M2, 3.0 M3, 3.0 M4, 3.0 RC1, 3.0 RC2, 3.0 RC3
Issue Links:
- Automatically expose @PathVariables in the Model [SPR-7543] #12200 Automatically expose
@PathVariables
in the Model ("is duplicated by")
7 votes, 6 watchers