| Method from org.apache.cactus.server.AbstractHttpServletRequestWrapper Detail: |
public Object getAttribute(String theName) {
return this.request.getAttribute(theName);
}
|
public Enumeration getAttributeNames() {
return this.request.getAttributeNames();
}
|
public String getAuthType() {
return this.request.getAuthType();
}
|
public String getCharacterEncoding() {
return this.request.getCharacterEncoding();
}
|
public int getContentLength() {
return this.request.getContentLength();
}
|
public String getContentType() {
return this.request.getContentType();
}
|
public String getContextPath() {
String result = this.request.getContextPath();
if ((this.url != null) && (this.url.getContextPath() != null))
{
result = this.url.getContextPath();
LOGGER.debug("Using simulated context : [" + result + "]");
}
return result;
}
|
public Cookie[] getCookies() {
return this.request.getCookies();
}
|
public long getDateHeader(String theName) {
return this.request.getDateHeader(theName);
}
|
public String getHeader(String theName) {
return this.request.getHeader(theName);
}
|
public Enumeration getHeaderNames() {
return this.request.getHeaderNames();
}
|
public Enumeration getHeaders(String theName) {
return this.request.getHeaders(theName);
}
|
public ServletInputStream getInputStream() throws IOException {
return this.request.getInputStream();
}
|
public int getIntHeader(String theName) {
return this.request.getIntHeader(theName);
}
|
public Locale getLocale() {
return this.request.getLocale();
}
|
public Enumeration getLocales() {
return this.request.getLocales();
}
|
public String getMethod() {
return this.request.getMethod();
}
|
public HttpServletRequest getOriginalRequest() {
return this.request;
}
|
public String getParameter(String theName) {
return this.request.getParameter(theName);
}
|
public Enumeration getParameterNames() {
return this.request.getParameterNames();
}
|
public String[] getParameterValues(String theName) {
return this.request.getParameterValues(theName);
}
|
public String getPathInfo() {
String result;
if (this.url != null)
{
result = this.url.getPathInfo();
LOGGER.debug("Using simulated PathInfo : [" + result + "]");
}
else
{
result = this.request.getPathInfo();
}
return result;
}
|
public String getPathTranslated() {
String pathTranslated;
if ((this.url != null) && (this.url.getPathInfo() != null))
{
String pathInfo = this.url.getPathInfo();
// If getRealPath returns null then getPathTranslated should also
// return null (see section SRV.4.5 of the Servlet 2.3 spec).
if (this.request.getRealPath("/") == null)
{
pathTranslated = null;
}
else
{
// Compute the translated path using the root real path
String newPathInfo = (pathInfo.startsWith("/")
? pathInfo.substring(1) : pathInfo);
if (this.request.getRealPath("/").endsWith("/"))
{
pathTranslated = this.request.getRealPath("/")
+ newPathInfo.replace('/", File.separatorChar);
}
else
{
pathTranslated = this.request.getRealPath("/")
+ File.separatorChar + newPathInfo.replace('/",
File.separatorChar);
}
}
}
else
{
pathTranslated = this.request.getPathTranslated();
}
return pathTranslated;
}
|
public String getProtocol() {
return this.request.getProtocol();
}
|
public String getQueryString() {
String result;
if (this.url != null)
{
result = this.url.getQueryString();
LOGGER.debug("Using simulated query string : [" + result + "]");
}
else
{
result = this.request.getQueryString();
}
return result;
}
|
public BufferedReader getReader() throws IOException {
return this.request.getReader();
}
|
public String getRealPath(String thePath) {
return this.request.getRealPath(thePath);
}
|
public String getRemoteAddr() {
String remoteIPAddress;
if (this.remoteIPAddress != null)
{
remoteIPAddress = this.remoteIPAddress;
}
else
{
remoteIPAddress = this.request.getRemoteAddr();
}
return remoteIPAddress;
}
|
public String getRemoteHost() {
String remoteHostName;
if (this.remoteHostName != null)
{
remoteHostName = this.remoteHostName;
}
else
{
remoteHostName = this.request.getRemoteHost();
}
return remoteHostName;
}
|
public String getRemoteUser() {
String remoteUser;
if (this.remoteUser != null)
{
remoteUser = this.remoteUser;
}
else
{
remoteUser = this.request.getRemoteUser();
}
return remoteUser;
}
|
public RequestDispatcher getRequestDispatcher(String thePath) {
// I hate it, but we have to write some logic here ! Ideally we
// shouldn't have to do this as it is supposed to be done by the servlet
// engine. However as we are simulating the request URL, we have to
// provide it ... This is where we can see the limitation of Cactus
// (it has to mock some parts of the servlet engine) !
if (thePath == null)
{
return null;
}
RequestDispatcher dispatcher = null;
String fullPath;
// The spec says that the path can be relative, in which case it will
// be relative to the request. So for relative paths, we need to take
// into account the simulated URL (ServletURL).
if (thePath.startsWith("/"))
{
fullPath = thePath;
}
else
{
String pI = getPathInfo();
if (pI == null)
{
fullPath = catPath(getServletPath(), thePath);
}
else
{
fullPath = catPath(getServletPath() + pI, thePath);
}
if (fullPath == null)
{
return null;
}
}
LOGGER.debug("Computed full path : [" + fullPath + "]");
dispatcher = new RequestDispatcherWrapper(
this.request.getRequestDispatcher(fullPath));
return dispatcher;
}
|
public String getRequestURI() {
String result;
if (this.url != null)
{
result = getContextPath()
+ ((getServletPath() == null) ? "" : getServletPath())
+ ((getPathInfo() == null) ? "" : getPathInfo());
LOGGER.debug("Using simulated request URI : [" + result + "]");
}
else
{
result = this.request.getRequestURI();
}
return result;
}
|
public String getRequestedSessionId() {
return this.request.getRequestedSessionId();
}
|
public String getScheme() {
return this.request.getScheme();
}
|
public String getServerName() {
String result = this.request.getServerName();
if ((this.url != null) && (this.url.getHost() != null))
{
result = this.url.getHost();
LOGGER.debug("Using simulated server name : [" + result + "]");
}
return result;
}
|
public int getServerPort() {
int result = this.request.getServerPort();
if ((this.url != null) && (this.url.getServerName() != null))
{
result = (this.url.getPort() == -1) ? 80 : this.url.getPort();
LOGGER.debug("Using simulated server port : [" + result + "]");
}
return result;
}
|
public String getServletPath() {
String result = this.request.getServletPath();
if ((this.url != null) && (this.url.getServletPath() != null))
{
result = this.url.getServletPath();
LOGGER.debug("Using simulated servlet path : [" + result + "]");
}
return result;
}
|
public HttpSession getSession() {
return this.request.getSession();
}
|
public HttpSession getSession(boolean isCreate) {
return this.request.getSession(isCreate);
}
|
public Principal getUserPrincipal() {
return this.request.getUserPrincipal();
}
|
public boolean isRequestedSessionIdFromCookie() {
return this.request.isRequestedSessionIdFromCookie();
}
|
public boolean isRequestedSessionIdFromURL() {
return this.request.isRequestedSessionIdFromURL();
}
|
public boolean isRequestedSessionIdFromUrl() {
return this.request.isRequestedSessionIdFromURL();
}
|
public boolean isRequestedSessionIdValid() {
return this.request.isRequestedSessionIdValid();
}
|
public boolean isSecure() {
return this.request.isSecure();
}
|
public boolean isUserInRole(String theRole) {
return this.request.isUserInRole(theRole);
}
|
public static AbstractHttpServletRequestWrapper newInstance(HttpServletRequest theOriginalRequest,
ServletURL theURL) {
try
{
Class clazz = Class.forName(
"org.apache.cactus.server.HttpServletRequestWrapper");
Object[] args = new Object[] {theOriginalRequest, theURL};
Constructor constructor = clazz.getConstructor(new Class[] {
HttpServletRequest.class, ServletURL.class });
return (AbstractHttpServletRequestWrapper) constructor.
newInstance(args);
}
catch (Throwable t)
{
throw new ChainedRuntimeException(
"Failed to create HttpServletRequestWrapper", t);
}
}
|
public void removeAttribute(String theName) {
this.request.removeAttribute(theName);
}
|
public void setAttribute(String theName,
Object theAttribute) {
this.request.setAttribute(theName, theAttribute);
}
|
public void setRemoteHostName(String theRemoteHostName) {
this.remoteHostName = theRemoteHostName;
}
Simulates the remote host name(ie the client host name). |
public void setRemoteIPAddress(String theRemoteIPAddress) {
this.remoteIPAddress = theRemoteIPAddress;
}
Simulates the remote IP address (ie the client IP address). |
public void setRemoteUser(String theRemoteUser) {
this.remoteUser = theRemoteUser;
}
Sets the remote user name to simulate. |