Class SpringWebFluxLinkBuilder
- Object
-
- org.thymeleaf.linkbuilder.AbstractLinkBuilder
-
- org.thymeleaf.linkbuilder.StandardLinkBuilder
-
- org.thymeleaf.spring5.linkbuilder.webflux.SpringWebFluxLinkBuilder
-
- All Implemented Interfaces:
org.thymeleaf.linkbuilder.ILinkBuilder
public class SpringWebFluxLinkBuilder extends org.thymeleaf.linkbuilder.StandardLinkBuilderSpring 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
nullatStandardLinkBuilder.buildLink(IExpressionContext, String, Map)if the specifiedbaseargument isnull.- Since:
- 3.0.3
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description SpringWebFluxLinkBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcomputeContextPath(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 StringprocessLink(org.thymeleaf.context.IExpressionContext context, String link)Process an already-built URL just before returning it.
-
-
-
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 ifcontextis not an instance ofISpringWebFluxContextgiven 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:
computeContextPathin classorg.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:
processLinkin classorg.thymeleaf.linkbuilder.StandardLinkBuilder- Parameters:
context- the execution context.link- the already-built URL.- Returns:
- the processed URL, ready to be used.
-
-