This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
My problem is this.
- i have a jsp page with a <form action="/etc" method="POST">..</form>
- i have a servlet: XServlet.java in which i override the doGet() and the doPost() methods.
- in my form i have some submit buttons...one for each table
- because i have the method declared to be on POST i thought that in my servlet i don't have to do anything else just write my logic in doPost method:P
Everything i do in my jsp page...all is going to the doGet method.(?!)
doGet method is called by the server (via the service method) to allow a servlet to handle a GET request.
As the form was submitted using POST method, doGet method won't get called and hence it won't print anything.
I don't get it. what am i doing wrong here? any ideas would make my day and make me learn something today.
Can you provide us the relevant part of the JSP page and the XServlet.java. Also you gave the code in which you were getting out the request method, were you getting GET as the output?? There might be a mistake somewhere in the code which we can only see after seeing the code...