com.vaadin.flow.server.
Class ServletHelper
- java.lang.Object
-
- com.vaadin.flow.server.ServletHelper
-
All Implemented Interfaces:
Deprecated.
UseHandlerHelper
instead
@Deprecated public class ServletHelper extends Object implements Serializable
Contains helper methods for
VaadinServlet
and generally for handlingVaadinRequests
.Since:
1.0
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
ServletHelper.RequestType
Deprecated.
Framework internal enum for tracking the type of a request.
-
Method Summary
All Methods Modifier and Type Method and Description static Locale
findLocale(VaadinSession session, VaadinRequest request)
Deprecated.
static String
getCancelingRelativePath(String pathToCancel)
Deprecated.
UseHandlerHelper.getCancelingRelativePath(String)
insteadstatic String
getContextRootRelativePath(VaadinServletRequest request)
Deprecated.
Don't use this method since it's tied toVaadinServletRequest
static boolean
isRequestType(VaadinRequest request, ServletHelper.RequestType requestType)
Deprecated.
static void
setResponseNoCacheHeaders(BiConsumer<String,String> headerSetter, BiConsumer<String,Long> longHeaderSetter)
Deprecated.
-
-
-
Method Detail
-
isRequestType
@Deprecated public static boolean isRequestType(VaadinRequest request, ServletHelper.RequestType requestType)
Deprecated. Use
HandlerHelper.isRequestType(VaadinRequest, com.vaadin.flow.server.HandlerHelper.RequestType)
insteadReturns whether the given request is of the given type.
Parameters:
request
- the request to checkrequestType
- the type to check forReturns:
true
if the request is of the given type,false
otherwise
-
findLocale
@Deprecated public static Locale findLocale(VaadinSession session, VaadinRequest request)
Deprecated. Use
HandlerHelper.findLocale(VaadinSession, VaadinRequest)
insteadHelper to find the most most suitable Locale. These potential sources are checked in order until a Locale is found:
- The passed component (or UI) if not null
UI.getCurrent()
if defined- The passed session if not null
VaadinSession.getCurrent()
if defined- The passed request if not null
VaadinService.getCurrentRequest()
if definedLocale.getDefault()
Parameters:
session
- the session that is searched for locale ornull
if not availablerequest
- the request that is searched for locale ornull
if not availableReturns:
the found locale
-
setResponseNoCacheHeaders
@Deprecated public static void setResponseNoCacheHeaders(BiConsumer<String,String> headerSetter, BiConsumer<String,Long> longHeaderSetter)
Deprecated. Use
HandlerHelper.setResponseNoCacheHeaders(BiConsumer, BiConsumer)
insteadSets no cache headers to the specified response.
Parameters:
headerSetter
- setter for string value headerslongHeaderSetter
- setter for long value headers
-
getCancelingRelativePath
@Deprecated public static String getCancelingRelativePath(String pathToCancel)
Deprecated. Use
HandlerHelper.getCancelingRelativePath(String)
insteadGets a relative path that cancels the provided path. This essentially adds one .. for each part of the path to cancel.
Parameters:
pathToCancel
- the path that should be canceledReturns:
a relative path that cancels out the provided path segment
-
getContextRootRelativePath
@Deprecated public static String getContextRootRelativePath(VaadinServletRequest request)
Deprecated. Don't use this method since it's tied to
VaadinServletRequest
Gets a relative path you can use to refer to the context root.
Parameters:
request
- the request for which the location should be determinedReturns:
A relative path to the context root. Never ends with a slash (/).
-
-