org.apache.cocoon.environment.http
Class HttpRequest

java.lang.Object
  extended byorg.apache.cocoon.environment.impl.AbstractRequest
      extended byorg.apache.cocoon.environment.http.HttpRequest
All Implemented Interfaces:
HttpServletRequest, org.apache.cocoon.environment.Request, ServletRequest, org.apache.cocoon.environment.ValueHolder

public final class HttpRequest
extends AbstractRequest

Implements the Request interface to provide request information in the HTTP servlets environment.

Version:
$Id: HttpRequest.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  String reqURI
           
 
Fields inherited from interface org.apache.cocoon.environment.Request
GLOBAL_SCOPE, REQUEST_SCOPE
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
protected HttpRequest(HttpServletRequest req, HttpEnvironment env)
          Creates a HttpRequest based on a real HttpServletRequest object
 
Method Summary
 Object get(String name)
           
 Object getAttribute(String name)
           
 Enumeration getAttributeNames()
           
 String getAuthType()
           
 String getCharacterEncoding()
           
 Map getCocoonCookieMap()
           
 org.apache.cocoon.environment.Cookie[] getCocoonCookies()
           
 org.apache.cocoon.environment.Session getCocoonSession()
           
 org.apache.cocoon.environment.Session getCocoonSession(boolean create)
           
 int getContentLength()
           
 String getContentType()
           
 String getContextPath()
           
 Map getCookieMap()
           
 Cookie[] getCookies()
           
 long getDateHeader(String name)
           
 String getHeader(String name)
           
 Enumeration getHeaderNames()
           
 Enumeration getHeaders(String name)
           
 ServletInputStream getInputStream()
           
 int getIntHeader(String name)
           
 Object getLocalAttribute(String name)
           
 Enumeration getLocalAttributeNames()
           
 Locale getLocale()
           
 Enumeration getLocales()
           
 String getMethod()
           
 String getParameter(String name)
           
 Enumeration getParameterNames()
           
 String[] getParameterValues(String name)
           
 String getPathInfo()
           
 String getPathTranslated()
           
 String getProtocol()
           
 String getQueryString()
           
 BufferedReader getReader()
           
 String getRealPath(String path)
          Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String)instead.
 String getRemoteAddr()
           
 String getRemoteHost()
           
 String getRemoteUser()
           
 RequestDispatcher getRequestDispatcher(String path)
           
 String getRequestedSessionId()
           
 String getRequestURI()
           
 String getScheme()
           
 String getServerName()
           
 int getServerPort()
           
 String getServletPath()
           
 HttpSession getSession()
           
 HttpSession getSession(boolean create)
           
 String getSitemapPath()
           
 String getSitemapURI()
           
 String getSitemapURIPrefix()
           
 Principal getUserPrincipal()
           
 boolean isRequestedSessionIdFromCookie()
           
 boolean isRequestedSessionIdFromUrl()
          Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
           
 boolean isSecure()
           
 boolean isUserInRole(String role)
           
 void removeAttribute(String name)
           
 void removeLocalAttribute(String name)
           
 Object searchAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 void setCharacterEncoding(String form_encoding)
           
 void setContainerEncoding(String container_encoding)
          Sets the default encoding of the servlet container.
 void setLocalAttribute(String name, Object value)
           
 
Methods inherited from class org.apache.cocoon.environment.impl.AbstractRequest
getAttributes, getHeaders, getLocalAddr, getLocalName, getLocalPort, getParameterMap, getParameters, getRemotePort, getRequestURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reqURI

protected String reqURI
Constructor Detail

HttpRequest

protected HttpRequest(HttpServletRequest req,
                      HttpEnvironment env)
Creates a HttpRequest based on a real HttpServletRequest object

Parameters:
req - The HttpServletReqeust
env - The HttpEnvironment
Method Detail

get

public Object get(String name)

getAuthType

public String getAuthType()

getCookies

public Cookie[] getCookies()

getCookieMap

public Map getCookieMap()

getCocoonCookies

public org.apache.cocoon.environment.Cookie[] getCocoonCookies()

getCocoonCookieMap

public Map getCocoonCookieMap()

getDateHeader

public long getDateHeader(String name)

getHeader

public String getHeader(String name)

getHeaders

public Enumeration getHeaders(String name)

getHeaderNames

public Enumeration getHeaderNames()

getIntHeader

public int getIntHeader(String name)
Specified by:
getIntHeader in interface HttpServletRequest
Overrides:
getIntHeader in class AbstractRequest

getMethod

public String getMethod()

getPathInfo

public String getPathInfo()

getPathTranslated

public String getPathTranslated()

getContextPath

public String getContextPath()

getQueryString

public String getQueryString()

getRemoteUser

public String getRemoteUser()

isUserInRole

public boolean isUserInRole(String role)

getUserPrincipal

public Principal getUserPrincipal()

getRequestedSessionId

public String getRequestedSessionId()

getRequestURI

public String getRequestURI()

getSitemapURI

public String getSitemapURI()

getSitemapURIPrefix

public String getSitemapURIPrefix()

getSitemapPath

public String getSitemapPath()

getServletPath

public String getServletPath()

getSession

public HttpSession getSession(boolean create)

getSession

public HttpSession getSession()

getCocoonSession

public org.apache.cocoon.environment.Session getCocoonSession(boolean create)

getCocoonSession

public org.apache.cocoon.environment.Session getCocoonSession()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.

Specified by:
isRequestedSessionIdFromUrl in interface HttpServletRequest
Overrides:
isRequestedSessionIdFromUrl in class AbstractRequest

getAttribute

public Object getAttribute(String name)

getAttributeNames

public Enumeration getAttributeNames()

setAttribute

public void setAttribute(String name,
                         Object value)

removeAttribute

public void removeAttribute(String name)

getLocalAttribute

public Object getLocalAttribute(String name)

getLocalAttributeNames

public Enumeration getLocalAttributeNames()

setLocalAttribute

public void setLocalAttribute(String name,
                              Object value)

removeLocalAttribute

public void removeLocalAttribute(String name)

getCharacterEncoding

public String getCharacterEncoding()

setCharacterEncoding

public void setCharacterEncoding(String form_encoding)
                          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

setContainerEncoding

public void setContainerEncoding(String container_encoding)
Sets the default encoding of the servlet container.

Parameters:
container_encoding - The default form encoding of the servlet container.

getContentLength

public int getContentLength()

getContentType

public String getContentType()

getInputStream

public ServletInputStream getInputStream()
                                  throws IOException
Throws:
IOException

getParameter

public String getParameter(String name)

getParameterNames

public Enumeration getParameterNames()

getParameterValues

public String[] getParameterValues(String name)

getProtocol

public String getProtocol()

getScheme

public String getScheme()

getServerName

public String getServerName()

getServerPort

public int getServerPort()

getReader

public BufferedReader getReader()
                         throws IOException
Specified by:
getReader in interface ServletRequest
Overrides:
getReader in class AbstractRequest
Throws:
IOException

getRemoteAddr

public String getRemoteAddr()

getRemoteHost

public String getRemoteHost()

getLocale

public Locale getLocale()

getLocales

public Enumeration getLocales()

isSecure

public boolean isSecure()

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface ServletRequest
Overrides:
getRequestDispatcher in class AbstractRequest

getRealPath

public String getRealPath(String path)
Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String)instead.

Specified by:
getRealPath in interface ServletRequest
Overrides:
getRealPath in class AbstractRequest

searchAttribute

public Object searchAttribute(String name)
See Also:
Request.searchAttribute(java.lang.String)


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.