dcsimg
doPost() is not called in servlet logic
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bubu_bubulina
Posted On:   Monday, September 14, 2009 10:56 AM

Hello My problem is this. - i have a jsp page with a .. - 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.(?!) view plaincopy to clipboardprint? 1. String requestType = request.getMethod(); 2. System.out.println("reqType(dinGet): " + requestType); String requestType = request.getMethod(); System.out.println("reqType(dinGet): " + requestTy   More>>

Hello
My problem is this.
- i have a jsp page with a

..
- 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.(?!)

view plaincopy to clipboardprint?

1. String requestType = request.getMethod();
2. System.out.println("reqType(dinGet): " + requestType);

String requestType = request.getMethod(); System.out.println("reqType(dinGet): " + requestType);

Searching the internet i found this: http://forums.sun.com/thread.jspa?threadID=5396213:

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.

neither doPost.



I don't get it. what am i doing wrong here? any ideas would make my day and make me learn something today.

Thank you in advanced    <<Less
About | Sitemap | Contact