Package com.vaadin.flow.spring
Class RootMappedCondition
- java.lang.Object
-
- com.vaadin.flow.spring.RootMappedCondition
-
- All Implemented Interfaces:
org.springframework.context.annotation.Condition
public class RootMappedCondition extends Object implements org.springframework.context.annotation.Condition
Condition to check whether the Vaadin servlet is mapped to the root ("/*").In this case a
DispatcherServletis used. It's mapped to the root instead of VaadinServlet and forwards requests toVaadinServlet. If there are other mappings (via Spring endpoints e.g.) thenDispatcherServletmakes it possible to handle them properly via those endpoints. OtherwiseVaadinServletwill handle all the URLs because it has the highest priority.- Author:
- Vaadin Ltd
-
-
Field Summary
Fields Modifier and Type Field Description static StringURL_MAPPING_PROPERTY
-
Constructor Summary
Constructors Constructor Description RootMappedCondition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetUrlMapping(org.springframework.core.env.Environment environment)Gets the url mapping in a way compatible with both plain Spring and Spring Boot.static booleanisRootMapping(String mapping)Returnstrueifmappingis the root mapping ("/*").booleanmatches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
-
-
-
Field Detail
-
URL_MAPPING_PROPERTY
public static final String URL_MAPPING_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
matches
public boolean matches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)- Specified by:
matchesin interfaceorg.springframework.context.annotation.Condition
-
getUrlMapping
public static String getUrlMapping(org.springframework.core.env.Environment environment)
Gets the url mapping in a way compatible with both plain Spring and Spring Boot.- Parameters:
environment- the application environment- Returns:
- the url mapping or null if none is defined
-
isRootMapping
public static boolean isRootMapping(String mapping)
Returnstrueifmappingis the root mapping ("/*").The mapping is controlled via the
vaadin.urlMappingproperty value. By default it's "/*".- Parameters:
mapping- the mapping string to check- Returns:
trueifmappingis the root mapping andfalseotherwise
-
-