In Servlet A's doPost, you can call doGet (still Servlet A) and then forward
to Servlet B.

Scott Evans




> -----Original Message-----
> From: Serbulent Ozturk [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 18, 2000 5:03 PM
> To: [EMAIL PROTECTED]
> Subject: doPost() to doGet() via RequestDispatcher
>
>
> Hi,
>
> My Servlet-(A) gets a POST request from a form after
> processing it I need to
> pass it to another Servlet-(B) but I need to pass it to
> Servlet(B)'s doGet()
> method.  As the original request line was POST, it always invokes
> Servlet-(B)'s doPost().
>
> <PRE>
> getServletContext().getRequestDispatcher("/servlet/B").include
> (req, res);
> <PRE>
>
>
> I guest I can set an attribute in the request in the
> Servlet-(A) before
> dispatching and retrieve it at the begginning of Servlet-(B)
> doPost() and if
> true call the doGet(), as a work around.
>
> However, although I could not fond t in API Socumentation, I
> think there
> must/should be a convential way of changing the Method type in the
> Request-Line dynamically, as it is encapsulated as an object, i.e.
> HttpServletRequest.
>
> Any ideas?
>
>
> Bulent
> ______________________________________________________________
> __________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to