com.vaadin.flow.spring.
Class RootMappedCondition
All Implemented Interfaces:
org.springframework.context.annotation.Condition
Condition to check whether the Vaadin servlet is mapped to the root ("/*").
In this case a DispatcherServlet
is used. It's mapped to the root
instead of VaadinServlet and forwards requests to VaadinServlet
. If
there are other mappings (via Spring endpoints e.g.) then
DispatcherServlet
makes it possible to handle them properly via those
endpoints. Otherwise VaadinServlet
will handle all the URLs because
it has the highest priority.
Author:
Vaadin Ltd
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getUrlMapping
(org.springframework.core.env.Environment environment) Gets the url mapping in a way compatible with both plain Spring and Spring Boot.
static boolean
isRootMapping
(String mapping) Returns
true
ifmapping
is the root mapping ("/*").boolean
matches
(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
-
Field Details
-
URL_MAPPING_PROPERTY
See Also:
-
-
Constructor Details
-
RootMappedCondition
public RootMappedCondition()
-
-
Method Details
-
matches
public boolean matches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata) Specified by:
matches
in interfaceorg.springframework.context.annotation.Condition
-
getUrlMapping
Gets the url mapping in a way compatible with both plain Spring and Spring Boot.
Parameters:
environment
- the application environmentReturns:
the url mapping or null if none is defined
-
isRootMapping
Returns
true
ifmapping
is the root mapping ("/*").The mapping is controlled via the
vaadin.urlMapping
property value. By default it's "/*".Parameters:
mapping
- the mapping string to checkReturns:
true
ifmapping
is the root mapping andfalse
otherwise
-