Originally posted by Sajee Joseph:
Hello all,
I have a certain question.
I need to call the doPost() method of a servlet(Servlet B) from another servlet ( servlet A). I tried doing so using the RequestDispather.forward().
But by doing so the doGet() method is called instead. Please note that the Servlet B is already existing one & i dont have the liberty of calling the doPost() method from the doGet().
How can i achieve this?
Regards,
Saj
Hi,
Two options are available.
1. If your current method type is post then it will automatically will forward to Post method.
2. Using the URLConnection Object you can call a servlet's doPost method.
Regards,
M.S.Raman