org.apache.jetspeed.request
Class PortalRequest

java.lang.Object
  extended byjavax.servlet.ServletRequestWrapper
      extended byjavax.servlet.http.HttpServletRequestWrapper
          extended byorg.apache.jetspeed.request.PortalRequest
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class PortalRequest
extends javax.servlet.http.HttpServletRequestWrapper

PortalRequest wraps the original request to the portal and keeps local references to properties like contextPath, servletPath and the Session when its created.

Some web servers like WebSphere don't store these properties inside the request but derive them dynamically based on the web application context in which they are invoked.

For cross-context invoked portlet applications, getting access to the portal contextPath using requestContext.getRequest().getContextPath() this clearly is a problem. Also, access to the Portal Session is not possible this way.

The requestContext.request is actually wrapped by this class which solves the problem by storing a reference to the actual properties at the time of creation and returning

Version:
$Id$
Author:
Ate Douma

Field Summary
private  String contextPath
           
private  String servletPath
           
private  javax.servlet.http.HttpSession session
           
 
Fields inherited from class javax.servlet.ServletRequestWrapper
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
PortalRequest(javax.servlet.http.HttpServletRequest request)
           
 
Method Summary
 String getContextPath()
           
 String getServletPath()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
           
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, 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 javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

contextPath

private final String contextPath

servletPath

private final String servletPath

session

private final javax.servlet.http.HttpSession session
Constructor Detail

PortalRequest

public PortalRequest(javax.servlet.http.HttpServletRequest request)
Method Detail

getContextPath

public String getContextPath()

getServletPath

public String getServletPath()

getSession

public javax.servlet.http.HttpSession getSession()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.