Package com.vaadin.flow.internal
Class BootstrapHandlerHelper
- java.lang.Object
-
- com.vaadin.flow.internal.BootstrapHandlerHelper
-
- All Implemented Interfaces:
Serializable
public final class BootstrapHandlerHelper extends Object implements Serializable
Helper methods for use in bootstrapping.For internal use only. May be renamed or removed in a future release.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
determinePushServletMapping(VaadinSession vaadinSession)
static String
findFirstUrlMapping(javax.servlet.ServletRegistration registration)
Returns the first of sorted URL mappings of the givenServletRegistration
, ignoring '/VAADIN/*' and '/vaadinServlet/*' mapping.static String
getCleanedPushServletMapping(String pushServletMapping)
Cleans up the given push servlet mapping value for proper use.static String
getPushURL(VaadinSession vaadinSession, VaadinRequest vaadinRequest)
Gets the push URL as a URL relative to the request URI.static String
getServiceUrl(VaadinRequest vaadinRequest)
Gets the service URL as a URL relative to the request URI.static Optional<javax.servlet.ServletRegistration>
getServletRegistration(javax.servlet.ServletConfig servletConfig)
Returns aServletRegistration
for the givenServletConfig
, if available.
-
-
-
Method Detail
-
getServiceUrl
public static String getServiceUrl(VaadinRequest vaadinRequest)
Gets the service URL as a URL relative to the request URI.- Parameters:
vaadinRequest
- the request- Returns:
- the relative service URL
-
getPushURL
public static String getPushURL(VaadinSession vaadinSession, VaadinRequest vaadinRequest)
Gets the push URL as a URL relative to the request URI.- Parameters:
vaadinSession
- the sessionvaadinRequest
- the request- Returns:
- the relative push URL
-
determinePushServletMapping
public static String determinePushServletMapping(VaadinSession vaadinSession)
-
getCleanedPushServletMapping
public static String getCleanedPushServletMapping(String pushServletMapping)
Cleans up the given push servlet mapping value for proper use. Effectively makes sure it starts and ends with a '/', and removes possible '/*' at the end.- Parameters:
pushServletMapping
- Original pushServletMapping value- Returns:
- cleaned-up value, or null if the original value is blank.
-
getServletRegistration
public static Optional<javax.servlet.ServletRegistration> getServletRegistration(javax.servlet.ServletConfig servletConfig)
Returns aServletRegistration
for the givenServletConfig
, if available.- Parameters:
servletConfig
-ServletConfig
to find the registration for.- Returns:
- an optional
ServletRegistration
, or an empty optional if a registration is not available.
-
findFirstUrlMapping
public static String findFirstUrlMapping(javax.servlet.ServletRegistration registration)
Returns the first of sorted URL mappings of the givenServletRegistration
, ignoring '/VAADIN/*' and '/vaadinServlet/*' mapping.- Parameters:
registration
-ServletRegistration
from which to look up the mappings.- Returns:
- first URL mapping, ignoring '/VAADIN/*' and '/vaadinServlet/*'
-
-