org.mortbay.jetty.servlet

Class ServletHttpRequest

public class ServletHttpRequest extends Object implements HttpServletRequest

Servlet Request Wrapper. This class wraps a Jetty HTTP request as a 2.2 Servlet request.

Note that this wrapper is not synchronized and if a request is to be operated on by multiple threads, then higher level synchronizations may be required.

Version: $Id: ServletHttpRequest.java,v 1.65 2005/08/13 00:01:27 gregwilkins Exp $

Author: Greg Wilkins (gregw)

Field Summary
static String__SESSIONID_COOKIE
static String__SESSIONID_NONE
static String__SESSIONID_NOT_CHECKED
static String__SESSIONID_URL
Constructor Summary
ServletHttpRequest(ServletHandler servletHandler, String pathInContext, HttpRequest request)
Constructor.
Method Summary
ObjectgetAttribute(String name)
EnumerationgetAttributeNames()
StringgetAuthType()
StringgetCharacterEncoding()
intgetContentLength()
StringgetContentType()
StringgetContextPath()
Cookie[]getCookies()
longgetDateHeader(String name)
StringgetHeader(String name)
EnumerationgetHeaderNames()
EnumerationgetHeaders(String s)
ServletInputStreamgetInputStream()
intgetIntHeader(String name)
StringgetLocalAddr()
LocalegetLocale()
EnumerationgetLocales()
StringgetLocalName()
intgetLocalPort()
StringgetMethod()
StringgetParameter(String name)
MapgetParameterMap()
This method is not recommended as it forces the generation of a non-optimal data structure.
EnumerationgetParameterNames()
String[]getParameterValues(String name)
StringgetPathInfo()
StringgetPathTranslated()
StringgetProtocol()
StringgetQueryString()
BufferedReadergetReader()
StringgetRealPath(String path)
StringgetRemoteAddr()
StringgetRemoteHost()
intgetRemotePort()
StringgetRemoteUser()
RequestDispatchergetRequestDispatcher(String url)
StringgetRequestedSessionId()
StringgetRequestURI()
StringBuffergetRequestURL()
StringgetScheme()
StringgetServerName()
intgetServerPort()
ServletHttpResponsegetServletHttpResponse()
StringgetServletPath()
HttpSessiongetSession(boolean create)
HttpSessiongetSession()
PrincipalgetUserPrincipal()
booleanisRequestedSessionIdFromCookie()
booleanisRequestedSessionIdFromUrl()
booleanisRequestedSessionIdFromURL()
booleanisRequestedSessionIdValid()
booleanisSecure()
booleanisUserInRole(String role)
voidremoveAttribute(String name)
voidsetAttribute(String name, Object value)
voidsetCharacterEncoding(String encoding)
StringtoString()
static ServletHttpRequestunwrap(ServletRequest request)
Unwrap a ServletRequest.

Field Detail

__SESSIONID_COOKIE

public static final String __SESSIONID_COOKIE

__SESSIONID_NONE

public static final String __SESSIONID_NONE

__SESSIONID_NOT_CHECKED

public static final String __SESSIONID_NOT_CHECKED

__SESSIONID_URL

public static final String __SESSIONID_URL

Constructor Detail

ServletHttpRequest

public ServletHttpRequest(ServletHandler servletHandler, String pathInContext, HttpRequest request)
Constructor.

Method Detail

getAttribute

public Object getAttribute(String name)

getAttributeNames

public Enumeration getAttributeNames()

getAuthType

public String getAuthType()

getCharacterEncoding

public String getCharacterEncoding()

getContentLength

public int getContentLength()

getContentType

public String getContentType()

getContextPath

public String getContextPath()

getCookies

public Cookie[] getCookies()

getDateHeader

public long getDateHeader(String name)

getHeader

public String getHeader(String name)

getHeaderNames

public Enumeration getHeaderNames()

getHeaders

public Enumeration getHeaders(String s)

getInputStream

public ServletInputStream getInputStream()

getIntHeader

public int getIntHeader(String name)

getLocalAddr

public String getLocalAddr()

getLocale

public Locale getLocale()

getLocales

public Enumeration getLocales()

getLocalName

public String getLocalName()

getLocalPort

public int getLocalPort()

getMethod

public String getMethod()

getParameter

public String getParameter(String name)

getParameterMap

public Map getParameterMap()
This method is not recommended as it forces the generation of a non-optimal data structure.

getParameterNames

public Enumeration getParameterNames()

getParameterValues

public String[] getParameterValues(String name)

getPathInfo

public String getPathInfo()

getPathTranslated

public String getPathTranslated()

getProtocol

public String getProtocol()

getQueryString

public String getQueryString()

getReader

public BufferedReader getReader()

getRealPath

public String getRealPath(String path)

Deprecated: As of Version 2.1 of the Java Servlet API, use {@link javax.servlet.ServletContext#getRealPath} instead.

getRemoteAddr

public String getRemoteAddr()

getRemoteHost

public String getRemoteHost()

getRemotePort

public int getRemotePort()

getRemoteUser

public String getRemoteUser()

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String url)

getRequestedSessionId

public String getRequestedSessionId()

getRequestURI

public String getRequestURI()

getRequestURL

public StringBuffer getRequestURL()

getScheme

public String getScheme()

getServerName

public String getServerName()

getServerPort

public int getServerPort()

getServletHttpResponse

public ServletHttpResponse getServletHttpResponse()

getServletPath

public String getServletPath()

getSession

public HttpSession getSession(boolean create)

getSession

public HttpSession getSession()

getUserPrincipal

public Principal getUserPrincipal()

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()

Deprecated:

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()

isSecure

public boolean isSecure()

isUserInRole

public boolean isUserInRole(String role)

removeAttribute

public void removeAttribute(String name)

setAttribute

public void setAttribute(String name, Object value)

setCharacterEncoding

public void setCharacterEncoding(String encoding)

toString

public String toString()

unwrap

public static ServletHttpRequest unwrap(ServletRequest request)
Unwrap a ServletRequest.

Parameters: request

Returns: The core ServletHttpRequest which must be the underlying request object

See Also: ServletRequestWrapper HttpServletRequestWrapper

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.