Class VaadinServletRequest

  • All Implemented Interfaces:
    VaadinRequest, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

    public class VaadinServletRequest
    extends javax.servlet.http.HttpServletRequestWrapper
    implements VaadinRequest
    Wrapper for HttpServletRequest.
    Since:
    1.0.
    Author:
    Vaadin Ltd
    See Also:
    VaadinRequest, VaadinServletResponse
    • Field Summary

      • Fields inherited from interface javax.servlet.http.HttpServletRequest

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • Constructor Summary

      Constructors 
      Constructor Description
      VaadinServletRequest​(javax.servlet.http.HttpServletRequest request, VaadinServletService vaadinService)
      Wraps a http servlet request and associates with a vaadin service.
    • Constructor Detail

      • VaadinServletRequest

        public VaadinServletRequest​(javax.servlet.http.HttpServletRequest request,
                                    VaadinServletService vaadinService)
        Wraps a http servlet request and associates with a vaadin service.
        Parameters:
        request - the http servlet request to wrap
        vaadinService - the associated vaadin service
    • Method Detail

      • getWrappedSession

        public WrappedSession 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 interface VaadinRequest
        Returns:
        the wrapped session for this request
        See Also:
        WrappedSession, HttpServletRequest.getSession()
      • getWrappedSession

        public WrappedSession getWrappedSession​(boolean allowSessionCreation)
        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 interface VaadinRequest
        Parameters:
        allowSessionCreation - true to create a new session for this request if necessary; false to return null if there's no current session
        Returns:
        the wrapped session for this request
        See Also:
        WrappedSession, HttpServletRequest.getSession(boolean)
      • getHttpServletRequest

        public javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Gets the original, unwrapped HTTP servlet request.
        Returns:
        the servlet request
      • getCurrent

        public static VaadinServletRequest 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