These folowing lines may be the answer to your question :
// Set the attribute and Forward to hello.jsp
request.setAttribute ("servletName", "servletToJsp");
getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/hello.jsp").forward(request,
response);
You can forward the request to a jsp or a servlet.
Bye. Sylvie.
Bartsch Axel a écrit :
> Hi,
>
> I have the following problem:
> a HTTP request is sent by a HTML page (within the browser) to servlet1:
> in the doPost(HttpServletRequest req, HttpServletResponse resp) of servlet1 this
>request is treated.
>
> Now during code processing servlet1 in some cases handles the sending of the HTTP
>response himself
> = normal servlet handling, no problem
> in some other cases (e.g. in case of error) servlet1 wants the request to be treated
>by servlet2:
> so servlet1 would like to send a HTTPrequest (new request or forward of original
>request) to servlet2.
> servlet1 would then like to return from its doPost(...) method without sending a
>HTTP response to the browser; it is servlet2
> instead that is then responsible for sending the HTTP response to the browser.
>
> And this is no servlet chaining:
> because:
> that another servlet is involved is not known before sending the HTTP request by the
>browser, it is known first during servlet1 code processing:
> so the servlet engine can not be configured accordingly.
> servlet1 does not setup a HTTP response which is then sent to servlet2 for further
>processing.
>
> Is this possible?
> How (code example) could this action be performed? Are there messages provided in
>the servlet API or must a 'normal' JAVA API be used for setting up a HTTP request?
>
> Axel, Lannion/France
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html