public class HandlerHelper extends Object implements Serializable
VaadinServlet
and generally for handling
VaadinRequests
.Modifier and Type | Class and Description |
---|---|
static class |
HandlerHelper.RequestType
Framework internal enum for tracking the type of a request.
|
Modifier and Type | Method and Description |
---|---|
static Locale |
findLocale(VaadinSession session,
VaadinRequest request)
Helper to find the most most suitable Locale.
|
static String |
getCancelingRelativePath(String pathToCancel)
Gets a relative path that cancels the provided path.
|
static boolean |
isRequestType(VaadinRequest request,
HandlerHelper.RequestType requestType)
Returns whether the given request is of the given type.
|
static void |
setResponseNoCacheHeaders(BiConsumer<String,String> headerSetter,
BiConsumer<String,Long> longHeaderSetter)
Sets no cache headers to the specified response.
|
public static boolean isRequestType(VaadinRequest request, HandlerHelper.RequestType requestType)
request
- the request to checkrequestType
- the type to check fortrue
if the request is of the given type,
false
otherwisepublic static Locale findLocale(VaadinSession session, VaadinRequest request)
UI.getCurrent()
if definedVaadinSession.getCurrent()
if definedVaadinService.getCurrentRequest()
if definedLocale.getDefault()
session
- the session that is searched for locale or null
if not availablerequest
- the request that is searched for locale or null
if not availablepublic static void setResponseNoCacheHeaders(BiConsumer<String,String> headerSetter, BiConsumer<String,Long> longHeaderSetter)
headerSetter
- setter for string value headerslongHeaderSetter
- setter for long value headerspublic static String getCancelingRelativePath(String pathToCancel)
pathToCancel
- the path that should be canceledCopyright © 2020. All rights reserved.