org.xins.common.servlet.container
Class XINSServletRequest

java.lang.Object
  extended byorg.xins.common.servlet.container.XINSServletRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest

public class XINSServletRequest
extends Object
implements HttpServletRequest

This class is an implementation of the HTTPServletRequest that can be called localy.

Version:
$Revision: 1.29.2.2 $ $Date: 2007/03/22 15:33:34 $
Author:
Anthony Goubard

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
XINSServletRequest(String url)
          Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.
XINSServletRequest(String url, char[] data, Map headers)
          Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.
XINSServletRequest(String url, char[] data, String contentType)
          Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.
XINSServletRequest(String method, String url, String data, Map headers)
          Creates a new servlet request with the specified method.
 
Method Summary
 Object getAttribute(String str)
           
 Enumeration getAttributeNames()
           
 String getAuthType()
           
 String getCharacterEncoding()
           
 int getContentLength()
           
 String getContentType()
           
 String getContextPath()
           
 Cookie[] getCookies()
           
 long getDateHeader(String str)
           
 String getHeader(String str)
           
 Enumeration getHeaderNames()
           
 Enumeration getHeaders(String str)
           
 ServletInputStream getInputStream()
           
 int getIntHeader(String str)
           
 Locale getLocale()
           
 Enumeration getLocales()
           
 String getMethod()
           
 String getParameter(String str)
           
 Map getParameterMap()
           
 Enumeration getParameterNames()
           
 String[] getParameterValues(String str)
           
 String getPathInfo()
           
 String getPathTranslated()
           
 String getProtocol()
           
 String getQueryString()
           
 BufferedReader getReader()
           
 String getRealPath(String str)
           
 String getRemoteAddr()
           
 String getRemoteHost()
           
 String getRemoteUser()
           
 RequestDispatcher getRequestDispatcher(String str)
           
 String getRequestedSessionId()
           
 String getRequestURI()
           
 StringBuffer getRequestURL()
           
 String getScheme()
           
 String getServerName()
           
 int getServerPort()
           
 String getServletPath()
           
 HttpSession getSession()
           
 HttpSession getSession(boolean create)
           
 Principal getUserPrincipal()
           
 boolean isRequestedSessionIdFromCookie()
           
 boolean isRequestedSessionIdFromUrl()
           
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
           
 boolean isSecure()
           
 boolean isUserInRole(String str)
           
 void removeAttribute(String str)
           
 void setAttribute(String str, Object obj)
           
 void setCharacterEncoding(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XINSServletRequest

public XINSServletRequest(String url)
Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.

Creates a new Servlet request.

Parameters:
url - the request URL or the list of the parameters (name=value) separated with comma's.

XINSServletRequest

public XINSServletRequest(String url,
                          char[] data,
                          String contentType)
Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.

Creates a new Servlet request.

Parameters:
url - the request URL or the list of the parameters (name=value) separated with comma's.
data - the content of the request.
contentType - the content type of the request.
Since:
XINS 1.3.0

XINSServletRequest

public XINSServletRequest(String url,
                          char[] data,
                          Map headers)
Deprecated. Since XINS 1.5.0. The way the HTTP method is determined is incorrect. Use XINSServletRequest(String,String,String,Map) instead.

Creates a new servlet request.

Parameters:
url - the request URL or the list of the parameters (name=value) separated with ampersands.
data - the content of the request.
headers - the HTTP headers of the request. The key and the value of the Map is a String.
Since:
XINS 1.4.0

XINSServletRequest

public XINSServletRequest(String method,
                          String url,
                          String data,
                          Map headers)
Creates a new servlet request with the specified method.

Parameters:
method - the request method, cannot be null.
url - the request URL or the list of the parameters (name=value) separated with ampersands.
data - the content of the request.
headers - the HTTP headers of the request. The key and the value of the Map is a String. The keys should all be in upper case.
Since:
XINS 1.5.0
Method Detail

setCharacterEncoding

public void setCharacterEncoding(String str)
Specified by:
setCharacterEncoding in interface ServletRequest

getParameterValues

public String[] getParameterValues(String str)
Specified by:
getParameterValues in interface ServletRequest

getParameter

public String getParameter(String str)
Specified by:
getParameter in interface ServletRequest

getIntHeader

public int getIntHeader(String str)
Specified by:
getIntHeader in interface HttpServletRequest

getAttribute

public Object getAttribute(String str)
Specified by:
getAttribute in interface ServletRequest

getDateHeader

public long getDateHeader(String str)
Specified by:
getDateHeader in interface HttpServletRequest

getHeader

public String getHeader(String str)
Specified by:
getHeader in interface HttpServletRequest

getHeaders

public Enumeration getHeaders(String str)
Specified by:
getHeaders in interface HttpServletRequest

getRealPath

public String getRealPath(String str)
Specified by:
getRealPath in interface ServletRequest

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String str)
Specified by:
getRequestDispatcher in interface ServletRequest

isUserInRole

public boolean isUserInRole(String str)
Specified by:
isUserInRole in interface HttpServletRequest

removeAttribute

public void removeAttribute(String str)
Specified by:
removeAttribute in interface ServletRequest

setAttribute

public void setAttribute(String str,
                         Object obj)
Specified by:
setAttribute in interface ServletRequest

getQueryString

public String getQueryString()
Specified by:
getQueryString in interface HttpServletRequest

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface ServletRequest

getPathTranslated

public String getPathTranslated()
Specified by:
getPathTranslated in interface HttpServletRequest

getPathInfo

public String getPathInfo()
Specified by:
getPathInfo in interface HttpServletRequest

getParameterNames

public Enumeration getParameterNames()
Specified by:
getParameterNames in interface ServletRequest

getParameterMap

public Map getParameterMap()
Specified by:
getParameterMap in interface ServletRequest

getMethod

public String getMethod()
Specified by:
getMethod in interface HttpServletRequest

getLocales

public Enumeration getLocales()
Specified by:
getLocales in interface ServletRequest

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletRequest

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface ServletRequest

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface HttpServletRequest

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletRequest

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface ServletRequest

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletRequest

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface HttpServletRequest

getCookies

public Cookie[] getCookies()
Specified by:
getCookies in interface HttpServletRequest

getHeaderNames

public Enumeration getHeaderNames()
Specified by:
getHeaderNames in interface HttpServletRequest

getInputStream

public ServletInputStream getInputStream()
Specified by:
getInputStream in interface ServletRequest

getReader

public BufferedReader getReader()
Specified by:
getReader in interface ServletRequest

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface ServletRequest

getRemoteHost

public String getRemoteHost()
Specified by:
getRemoteHost in interface ServletRequest

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface HttpServletRequest

getRequestURI

public String getRequestURI()
Specified by:
getRequestURI in interface HttpServletRequest

getRequestURL

public StringBuffer getRequestURL()
Specified by:
getRequestURL in interface HttpServletRequest

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface HttpServletRequest

getScheme

public String getScheme()
Specified by:
getScheme in interface ServletRequest

getServerName

public String getServerName()
Specified by:
getServerName in interface ServletRequest

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface ServletRequest

getServletPath

public String getServletPath()
Specified by:
getServletPath in interface HttpServletRequest

getSession

public HttpSession getSession()
Specified by:
getSession in interface HttpServletRequest

getSession

public HttpSession getSession(boolean create)
Specified by:
getSession in interface HttpServletRequest

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface HttpServletRequest

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Specified by:
isRequestedSessionIdFromCookie in interface HttpServletRequest

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface HttpServletRequest

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Specified by:
isRequestedSessionIdFromUrl in interface HttpServletRequest

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface HttpServletRequest

isSecure

public boolean isSecure()
Specified by:
isSecure in interface ServletRequest


See http://www.xins.org/.