views:

241

answers:

1

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/123/bookings/booking-123", and in the view, there is a need to link back to the bookings listing "/hotels/123/bookings/". How do I get a hook to {hotel} from the URI template to generate the link? It seems clunky to inject this into each view, is there a simpler way that I am missing?

+3  A: 

This has been raised as a feature in Spring.

Rich Kroll
And accepted for fix in 3.0.1 - Top banana.
skaffman