This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Hi, I have a jsp page (test.jsp), two servlets (Servlet1 and Servlet2). In test.jsp, parameters are submitted using a form and test.jsp calls Servlet1's doPost method. Then, in Servlet1, I use response.sendRedirect("/Servlet2") or getServletContext.getRequestDispatcher("/Servlet2") to call the second servlet. My problems are: (1) Servlet1 always called the doGet method of Servlet2, I want Servlet1 to call the doPost method of Servlet2. (2) The parameters sent from test.jsp are not passed from Servlet1 to Servlet2. Can someone help?
Hi Mike, doGet() method is called by default when the form's method attribute is not explicitly set. You must use requestdispatcher.forward("/servlet")to call the next servlet in chain. Then the doPost() method will be invoked and request parameters will be available to the servlet. Regards, [ March 25, 2003: Message edited by: Lakshmi Dasari ]