thymeleaf / thymeleaf-spring

Thymeleaf integration module for Spring
http://www.thymeleaf.org
Apache License 2.0
435 stars 157 forks source link

Support for MvcUriComponentsBuilder in spring dialect? #70

Closed bclozel closed 9 years ago

bclozel commented 9 years ago

I've taken a look at this repo, and I didn't find support for MvcUriComponentsBuilder (building URIs to controller actions within views), available as of Spring 4.1. Is this already supported in some way?

If not how would you do it?

Reference: https://stackoverflow.com/questions/27080454/playframework2-like-reverse-routing-in-spring/27090639

masterdany88 commented 9 years ago

Hey. If it's added to Thymeleaf 2.1 milestone, when it will be released. I am asking for aproximate date. Will it be in this year? I've just started to write my own reverse routing mechanism, and I dont know should I continue?

danielfernandez commented 9 years ago

Just to clarify: this ticket has been assigned to the 2.1 Milestone because it refers to the Thymeleaf 2.1 branch and, if it were developed, it would probably be for the 2.1 version. But it is under evaluation yet, unfortunately I cannot tell you whether it will be 2.1.4, 2.1.5... or ever, because it hasn't been evaluated yet :-)

What I can tell you is that the idea is to release 2.1.4 in the next days.

masterdany88 commented 9 years ago

Ok. I will be waiting. Thanks

bclozel commented 9 years ago

Awesome, thanks @danielfernandez - let us know if you need some help on this (like how you'd do it) and we can submit PRs.

danielfernandez commented 9 years ago

This support has been added by means of a new #mvc expression utility object.

It provides a method, #mvc.uri(...) that works exactly the same as the s:mvcUri(...) function from the Spring JSP tag libraries. A simple example can be seen in this test: https://github.com/thymeleaf/thymeleaf-tests/blob/b6fa2da3f6bea7bc9ba6dcf419f000be49c9fd97/src/test-21-spring41/resources/engine21spring41/springintegration/uri/uri01.thtest

2.1.4-SNAPSHOT has been updated, in case you want to test.

danielfernandez commented 9 years ago

Thymeleaf 2.1.4 has just been published, including this improvement.