com.vaadin.server
Class VaadinServletRequest

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by com.vaadin.server.VaadinServletRequest
All Implemented Interfaces:
VaadinRequest, java.io.Serializable, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class VaadinServletRequest
extends javax.servlet.http.HttpServletRequestWrapper
implements VaadinRequest

Wrapper for HttpServletRequest.

Since:
7.0
Author:
Vaadin Ltd.
See Also:
VaadinRequest, VaadinServletResponse, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.server.VaadinRequest
VaadinRequest.BrowserDetails
 
Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
VaadinServletRequest(javax.servlet.http.HttpServletRequest request, VaadinServletService vaadinService)
          Wraps a http servlet request and associates with a vaadin service
 
Method Summary
static VaadinServletRequest cast(VaadinRequest request)
          Helper method to get a VaadinServletRequest from a VaadinRequest.
 VaadinRequest.BrowserDetails getBrowserDetails()
          Gets detailed information about the browser from which the request originated.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Gets the original, unwrapped HTTP servlet request.
 java.lang.String getRequestPathInfo()
          Gets the path of the requested resource relative to the application.
 VaadinServletService getService()
          Gets the vaadin service for the context of this request.
 WrappedSession getWrappedSession()
          Gets the session associated with this request, creating a new if there is no session.
 WrappedSession getWrappedSession(boolean allowSessionCreation)
          Gets the session associated with this request, optionally creating a new if there is no session.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.server.VaadinRequest
getAttribute, getContentLength, getContentType, getContextPath, getHeader, getInputStream, getLocale, getParameter, getParameterMap, getRemoteAddr, isSecure, setAttribute
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

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

getRequestPathInfo

public java.lang.String getRequestPathInfo()
Description copied from interface: VaadinRequest
Gets the path of the requested resource relative to the application. The path be null if no path information is available. Does always start with / if the path isn't null.

Specified by:
getRequestPathInfo in interface VaadinRequest
Returns:
a string with the path relative to the application.
See Also:
HttpServletRequest.getPathInfo()

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(), PortletRequest.getPortletSession()

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), PortletRequest.getPortletSession(boolean)

getHttpServletRequest

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

Returns:
the servlet request

getService

public VaadinServletService getService()
Description copied from interface: VaadinRequest
Gets the vaadin service for the context of this request.

Specified by:
getService in interface VaadinRequest
Returns:
the vaadin service
See Also:
VaadinService

getBrowserDetails

public VaadinRequest.BrowserDetails getBrowserDetails()
Description copied from interface: VaadinRequest
Gets detailed information about the browser from which the request originated. This consists of information that is not available from normal HTTP requests, but requires additional information to be extracted for instance using javascript in the browser. This information is only guaranteed to be available in some special cases, for instance in UI.init(VaadinRequest).

Specified by:
getBrowserDetails in interface VaadinRequest
Returns:
the browser details, or null if details are not available
See Also:
VaadinRequest.BrowserDetails

cast

public static VaadinServletRequest cast(VaadinRequest request)
Helper method to get a VaadinServletRequest from a VaadinRequest. Aside from casting, this method also takes care of situations where there's another level of wrapping.

Parameters:
request - a Vaadin request
Returns:
a Vaadin http servlet request
Throws:
java.lang.ClassCastException - if the Vaadin request doesn't wrap a http servlet request


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.