I am facing this problem in my application. I have two servlets, servlet A and servlet B. Servlet A receives a GET request , process the request and forwards it to servlet B. Servlet B handles POST requests only. I shouldn't change the code of Servlet B. Is it possible to change the request type from GET to POST in servlet A or Is there any way to create a new POST request from servlet A to servlet B. Any information on this is really useful.
The method property of HttpServletRequest is read only.
Adding a doGet method to servlet B would be the easiest thing to do but if that's not possible, you could wrap the request, providing your own getMethod method. The servlet spec provides the HttpServletRequestWrapper to take some of the grunt work out of this.