Servlet call from "Form using POST method" doen't work???

Discussions

Web tier: servlets, JSP, Web frameworks: Servlet call from "Form using POST method" doen't work???

  1. Hi,
    I have installed Apache with JServ 1.1.1 on SunOS 5.8 and running it on port 9000.
    When I point browser "http:localhost:9000/servlet/Hello"
    by typing directly, it works fine.
    But if if try to invoke this servlet from a form as action using "POST" method, it doesn't work and I get "HTTP 400 - Bad Request" error but if i just refresh the page with current URL it shows result fine.
    I tried to make a request from a "form" with "GET" method, this time it works fine and give the desired result.

    Can anyone tell me that why a Servlet is not being inviked from a "form" using method "POST"?

    Here I have taken servlet "Hello" as example. infact I am getting this problem as common for every servlet.

    Thanks in advance, would appreciate if you can mail me at d_k_gupta at yahoo dot com

    Thanks
    Devendra
  2. hi
    doGet is the default method in the servelet.If you call doget from post in the form it won't work.If you make dopost in the servlet it will work.Check what you have done

    keerthikanth
  3. Thank you very much Keerthi!