New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAJOR FEAT] New extension point: Link Builders #458

danielfernandez opened this Issue Feb 4, 2016 · 1 comment


None yet
1 participant

danielfernandez commented Feb 4, 2016

Thymeleaf 3.0 will introduce a new extension point that will allow developers to configure the way they want link URLs to be built in Thymeleaf views, most usually in @{...} Thymeleaf Standard Expressions.

The new extension point will be the org.thymeleaf.ILinkBuilder interface, and the mechanism used for building link URLs in previous versions of Thymeleaf will still be considered the default one, and available as the org.thymeleaf.StandardLinkBuilder implementation.

public interface ILinkBuilder {

    public String getName();

    public Integer getOrder();

    public String buildLink(
            final IExpressionContext context, 
            final String base, final Map<String, Object> parameters);


The TemplateEngine class will have methods for configuring the link builders equivalent to those used for configuring message resolvers: 'ILinkBuilder getLinkBuilders(),setLinkBuilders(Set),setLinkBuilder(ILinkBuilder)andaddLinkBuilder(ILinkBuilder)`.

Note that this new extension point effectively allows decoupling the link building mechanism in Thymeleaf from the Java Servlet API (still required by StandardLinkBuilder), and enables developers to create integrations for Thymeleaf link building in web environments that do not make use of the Servlet API (vert.x, ratpack...)


This comment has been minimized.

Show comment
Hide comment

danielfernandez Feb 4, 2016


Already in 3.0.0-SNAPSHOT


danielfernandez commented Feb 4, 2016

Already in 3.0.0-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment