Package com.vaadin.flow.server
Class FrontendDependencyUrlResolver
java.lang.Object
com.vaadin.flow.server.FrontendDependencyUrlResolver
- All Implemented Interfaces:
Serializable
Resolves the
value() of frontend dependency annotations to a
canonical form that
BootstrapHandler.BootstrapUriResolver can
expand at render time. The same rules are used whether the annotation is on
an AppShellConfigurator or on an
ordinary Component.
Used for StyleSheet values, and
for the JavaScript values that
are loaded at runtime instead of being bundled. Callers should note that a
rejected value (see the rules below) yields null rather than an
exception, and that the dependency is then skipped.
For internal framework use only.
- Since:
- 25.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringresolveToContextRoot(String rawValue) Normalizes a frontend-dependency URL value to a form that the bootstrap URI resolver can expand.
-
Method Details
-
resolveToContextRoot
Normalizes a frontend-dependency URL value to a form that the bootstrap URI resolver can expand.Rules, in order:
nullor blank values returnnull.- Values containing path traversals (
..) are rejected with a warning andnullis returned. http://,https://,//,context://andbase://prefixes are returned unchanged.- A leading
./is stripped. - If the value (after the previous step) starts with
/, it is returned unchanged. - Otherwise,
context://is prepended so the value resolves against the servlet context root.
- Parameters:
rawValue- the raw annotation value- Returns:
- the normalized value, or
nullif rejected
-