Package com.vaadin.flow.server
Class VaadinServletRequest
java.lang.Object
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
com.vaadin.flow.server.VaadinServletRequest
- All Implemented Interfaces:
VaadinRequest
,jakarta.servlet.http.HttpServletRequest
,jakarta.servlet.ServletRequest
public class VaadinServletRequest
extends jakarta.servlet.http.HttpServletRequestWrapper
implements VaadinRequest
Wrapper for
HttpServletRequest
.- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
ConstructorDescriptionVaadinServletRequest
(jakarta.servlet.http.HttpServletRequest request, VaadinServletService vaadinService) Wraps a http servlet request and associates with a vaadin service. -
Method Summary
Modifier and TypeMethodDescriptionstatic VaadinServletRequest
Gets the currently processed Vaadin servlet request.jakarta.servlet.http.HttpServletRequest
Gets the original, unwrapped HTTP servlet request.Gets the vaadin service for the context of this request.Gets the session associated with this request, creating a new if there is no session.getWrappedSession
(boolean allowSessionCreation) Gets the session associated with this request, optionally creating a new if there is no session.Methods inherited from class jakarta.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
Methods inherited from class jakarta.servlet.ServletRequestWrapper
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
Methods inherited from interface com.vaadin.flow.server.VaadinRequest
getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getLocale, getLocales, getMethod, getParameter, getParameterMap, getPathInfo, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRemoteUser, getUserPrincipal, isSecure, isUserInRole, removeAttribute, setAttribute
-
Constructor Details
-
VaadinServletRequest
public VaadinServletRequest(jakarta.servlet.http.HttpServletRequest request, VaadinServletService vaadinService) Wraps a http servlet request and associates with a vaadin service.- Parameters:
request
- the http servlet request to wrapvaadinService
- the associated vaadin service
-
-
Method Details
-
getWrappedSession
Description copied from interface:VaadinRequest
Gets the session associated with this request, creating a new if there is no session.- Specified by:
getWrappedSession
in interfaceVaadinRequest
- Returns:
- the wrapped session for this request
- See Also:
-
WrappedSession
HttpServletRequest.getSession()
-
getWrappedSession
Description copied from interface:VaadinRequest
Gets the session associated with this request, optionally creating a new if there is no session.- Specified by:
getWrappedSession
in interfaceVaadinRequest
- Parameters:
allowSessionCreation
-true
to create a new session for this request if necessary;false
to returnnull
if there's no current session- Returns:
- the wrapped session for this request
- See Also:
-
WrappedSession
HttpServletRequest.getSession(boolean)
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()Gets the original, unwrapped HTTP servlet request.- Returns:
- the servlet request
-
getService
Description copied from interface:VaadinRequest
Gets the vaadin service for the context of this request.- Specified by:
getService
in interfaceVaadinRequest
- Returns:
- the vaadin service
- See Also:
-
getCurrent
Gets the currently processed Vaadin servlet request. The current request is automatically defined when the request is started. The current request can not be used in e.g. background threads because of the way server implementations reuse request instances.- Returns:
- the current Vaadin servlet request instance if available,
otherwise
null
-