Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.meterware.servletunit
Class RequestDispatcherImpl  view RequestDispatcherImpl download RequestDispatcherImpl.java

java.lang.Object
  extended bycom.meterware.servletunit.RequestContext
      extended bycom.meterware.servletunit.RequestDispatcherImpl
All Implemented Interfaces:
javax.servlet.RequestDispatcher

class RequestDispatcherImpl
extends RequestContext
implements javax.servlet.RequestDispatcher


Field Summary
private  ServletMetaData _servletMetaData
           
 
Constructor Summary
(package private) RequestDispatcherImpl(WebApplication application, java.net.URL url)
           
 
Method Summary
 void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
(package private)  java.lang.String getParameter(java.lang.String name)
           
(package private)  java.util.Map getParameterMap()
           
(package private)  java.util.Enumeration getParameterNames()
           
(package private)  java.lang.String[] getParameterValues(java.lang.String name)
           
(package private)  java.lang.String getRequestURI()
           
 ServletMetaData getServletMetaData()
           
 void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Includes the content of a resource (servlet, JSP page, HTML file) in the response.
(package private)  void loadParameters(java.lang.String queryString, boolean urlEncoded)
          This method employs a state machine to parse a parameter query string.
(package private)  void setMessageBody(byte[] bytes)
           
 void setMessageEncoding(java.lang.String messageEncoding)
           
(package private)  void setParentRequest(javax.servlet.http.HttpServletRequest parentRequest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_servletMetaData

private ServletMetaData _servletMetaData
Constructor Detail

RequestDispatcherImpl

RequestDispatcherImpl(WebApplication application,
                      java.net.URL url)
                throws javax.servlet.ServletException
Method Detail

getServletMetaData

public ServletMetaData getServletMetaData()

forward

public void forward(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from interface: javax.servlet.RequestDispatcher
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response.

For a RequestDispatcher obtained via getRequestDispatcher(), the ServletRequest object has its path elements and parameters adjusted to match the path of the target resource.

forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the javax.servlet.ServletRequestWrapper or javax.servlet.ServletResponseWrapper classes that wrap them.

Specified by:
forward in interface javax.servlet.RequestDispatcher

include

public void include(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from interface: javax.servlet.RequestDispatcher
Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

The javax.servlet.ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the javax.servlet.ServletRequestWrapper or javax.servlet.ServletResponseWrapper classes that wrap them.

Specified by:
include in interface javax.servlet.RequestDispatcher

setParentRequest

void setParentRequest(javax.servlet.http.HttpServletRequest parentRequest)

getRequestURI

java.lang.String getRequestURI()

getParameter

java.lang.String getParameter(java.lang.String name)

getParameterNames

java.util.Enumeration getParameterNames()

getParameterMap

java.util.Map getParameterMap()

getParameterValues

java.lang.String[] getParameterValues(java.lang.String name)

loadParameters

void loadParameters(java.lang.String queryString,
                    boolean urlEncoded)
This method employs a state machine to parse a parameter query string. The transition rules are as follows: State \ text '=' '&' initial: have_name - initial have_name: - have_equals initial have_equals: have_value - initial have_value: - initial initial actions occur on the following transitions: initial -> have_name: save token as name have_equals -> initial: record parameter with null value have_value -> initial: record parameter with value


setMessageBody

void setMessageBody(byte[] bytes)

setMessageEncoding

public void setMessageEncoding(java.lang.String messageEncoding)