Class PrefixingSupportingWebAppLinkBuilder
java.lang.Object
com.foreach.across.modules.web.context.PrefixingSupportingWebAppLinkBuilder
- All Implemented Interfaces:
WebAppLinkBuilder
Default implementation of
WebAppLinkBuilder
that will resolve any prefixed url
and url encode it afterwards. Supports prefix-based urls (eg. @static:/myresource) and
avoids urls starting with mailto: or # to be encoded.
Note this implementation requires a HttpServletRequest
and HttpServletResponse
to be available, so it can only be used within a request-bound thread.- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Constructor Summary
ConstructorDescriptionPrefixingSupportingWebAppLinkBuilder
(WebAppPathResolver pathResolver, jakarta.servlet.ServletContext servletContext) -
Method Summary
Modifier and TypeMethodDescriptionConvert the base link to an actual client-side link by processing prefixes, adding the context path and encoding the resulting url.Convert the base link to an actual client-side link by processing prefixes, adding the context path and (optionally) encoding the resulting url.
-
Constructor Details
-
PrefixingSupportingWebAppLinkBuilder
public PrefixingSupportingWebAppLinkBuilder(WebAppPathResolver pathResolver, jakarta.servlet.ServletContext servletContext)
-
-
Method Details
-
buildLink
Description copied from interface:WebAppLinkBuilder
Convert the base link to an actual client-side link by processing prefixes, adding the context path and encoding the resulting url.- Specified by:
buildLink
in interfaceWebAppLinkBuilder
- Parameters:
baseLink
- to process- Returns:
- processed link
-
buildLink
Description copied from interface:WebAppLinkBuilder
Convert the base link to an actual client-side link by processing prefixes, adding the context path and (optionally) encoding the resulting url.- Specified by:
buildLink
in interfaceWebAppLinkBuilder
- Parameters:
baseLink
- to processencodeUrl
- true if the url should be encoded afterwards (appends session id)- Returns:
- processed link
-