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
ConstructorsConstructorDescriptionVaadinServletRequest(jakarta.servlet.http.HttpServletRequest request, VaadinServletService vaadinService) Wraps a http servlet request and associates with a vaadin service. -
Method Summary
Modifier and TypeMethodDescriptionstatic VaadinServletRequestGets the currently processed Vaadin servlet request.jakarta.servlet.http.HttpServletRequestGets 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, upgradeMethods 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, setCharacterEncoding, setRequest, startAsync, startAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, setCharacterEncoding, startAsync, startAsyncMethods 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:VaadinRequestGets the session associated with this request, creating a new if there is no session.- Specified by:
getWrappedSessionin interfaceVaadinRequest- Returns:
- the wrapped session for this request
- See Also:
-
WrappedSessionHttpServletRequest.getSession()
-
getWrappedSession
Description copied from interface:VaadinRequestGets the session associated with this request, optionally creating a new if there is no session.- Specified by:
getWrappedSessionin interfaceVaadinRequest- Parameters:
allowSessionCreation-trueto create a new session for this request if necessary;falseto returnnullif there's no current session- Returns:
- the wrapped session for this request
- See Also:
-
WrappedSessionHttpServletRequest.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:VaadinRequestGets the vaadin service for the context of this request.- Specified by:
getServicein 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
-