Class SpringWebFluxLinkBuilder

  • All Implemented Interfaces:
    org.thymeleaf.linkbuilder.ILinkBuilder

    public class SpringWebFluxLinkBuilder
    extends org.thymeleaf.linkbuilder.StandardLinkBuilder

    Spring WebFlux-based implementation of ILinkBuilder.

    This class will build link URLs using the Spring WebFlux API and adapting to the needs of this type of application.

    This implementation will only return null at StandardLinkBuilder.buildLink(IExpressionContext, String, Map) if the specified base argument is null.

    Since:
    3.0.3
    Author:
    Daniel Fernández
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.thymeleaf.linkbuilder.StandardLinkBuilder

        org.thymeleaf.linkbuilder.StandardLinkBuilder.LinkType
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String computeContextPath​(org.thymeleaf.context.IExpressionContext context, String base, Map<String,​Object> parameters)
      Compute the context path to be applied to URLs that have been determined to be context-relative (and therefore might need a context path to be inserted at their beginning).
      protected String processLink​(org.thymeleaf.context.IExpressionContext context, String link)
      Process an already-built URL just before returning it.
      • Methods inherited from class org.thymeleaf.linkbuilder.StandardLinkBuilder

        buildLink
      • Methods inherited from class org.thymeleaf.linkbuilder.AbstractLinkBuilder

        getName, getOrder, setName, setOrder
    • Constructor Detail

      • SpringWebFluxLinkBuilder

        public SpringWebFluxLinkBuilder()
    • Method Detail

      • computeContextPath

        protected String computeContextPath​(org.thymeleaf.context.IExpressionContext context,
                                            String base,
                                            Map<String,​Object> parameters)

        Compute the context path to be applied to URLs that have been determined to be context-relative (and therefore might need a context path to be inserted at their beginning).

        This method will obtain the context path from ServerHttpRequest.getContextPath(), throwing an exception if context is not an instance of ISpringWebFluxContext given context-relative URLs are (by default) only allowed in Spring WebFlux contexts.

        This method can be overridden by any subclasses that want to change this behaviour.

        Overrides:
        computeContextPath in class org.thymeleaf.linkbuilder.StandardLinkBuilder
        Parameters:
        context - the execution context.
        base - the URL base specified.
        parameters - the URL parameters specified.
        Returns:
        the context path.
      • processLink

        protected String processLink​(org.thymeleaf.context.IExpressionContext context,
                                     String link)

        Process an already-built URL just before returning it.

        This method can be overridden by any subclasses that want to change this behaviour.

        Overrides:
        processLink in class org.thymeleaf.linkbuilder.StandardLinkBuilder
        Parameters:
        context - the execution context.
        link - the already-built URL.
        Returns:
        the processed URL, ready to be used.