|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.servlet.servletManager.EnhydraRequestDispatcher
Processes requests for resources at a particular path, including Servlets, Enhydra Apps, and Web Apps.
ServletContext.getRequestDispatcher(java.lang.String)
Constructor Summary | |
EnhydraRequestDispatcher(java.lang.String urlPath)
Creates a new RequestDispatcher for the given url path. |
Method Summary | |
void |
forward(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Forwards a ServletRequest object from
this servlet to a resource (servlet, JSP file, or
HTML file) on the server. |
void |
include(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Includes the content of a resource in the response of the calling servlet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EnhydraRequestDispatcher(java.lang.String urlPath)
urlPath
- a String URL path that the dispatcher will handle request for.Method Detail |
public void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
ServletRequest
object from
this servlet to a resource (servlet, JSP file, or
HTML file) on the server. You can use this method
when one servlet does preliminary processing of
a request and lets another resource generate
the response.
The ServletRequest
object has its
path and other parameters adjusted to be relative
to the path of the target resource.
You cannot use forward
if the target
resource has already returned a ServletOutputStream
or PrintWriter
object to the servlet.
In that situation, forward
throws
an IllegalStateException
.
forward
in interface javax.servlet.RequestDispatcher
request
- a ServletRequest
object
that represents the request the client
makes of the servletresponse
- a ServletResponse
object
that represents the response the servlet
returns to the client
javax.servlet.ServletException
- if the target resource is a servlet and
throws an exception
java.io.IOException
- if an input or output exception occurs
java.lang.IllegalStateException
- if the target resource returned
a ServletOutputStream
or
PrintWriter
object before
this method was calledpublic void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
The ServletResponse
object passed to this
servlet has the caller's request path. The response
object only has access to this servlet's
ServletOutputStream
and PrintWriter
objects.
A servlet that calls include
cannot
set response headers. If the servlet that calls
include
also calls methods that set
headers, include
is not guaranteed
to work.
include
in interface javax.servlet.RequestDispatcher
request
- a ServletRequest
object
that contains the client's requestresponse
- a ServletResponse
object
that contains the servlet's response
javax.servlet.ServletException
- if the target servlet throws a servlet
exception
java.io.IOException
- if the servlet has already obtained
a ServletOutputStream
or
print writer object from the
ServletResponse
object
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |