users@glassfish.java.net

http post not working

From: <glassfish_at_javadesktop.org>
Date: Sun, 13 Jun 2010 07:36:44 PDT

Hi,

I'm facing very strange behavior with my GlassFish application server where the following code is not sending the request parameters to the server. (Well the request parameters are having null values). But if I change the method do 'get' everything is fine.

<form name="form" method="post" action="upload" >
    <input id="test" name="test" type="hidden" value="This is the data"> <br/>
    <input id="submitButton" type="submit"/>
</form>

----------------------------------------- The servlet code ---------------------------------
protected void doGet(HttpServletRequest request,
          HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
  }

  protected void doPost(HttpServletRequest request,
          HttpServletResponse response) throws ServletException, IOException {
    HttpSession session = request.getSession();

     System.out.println("~~~~~~~~~~~~~~~~~~~~" + request.getQueryString());
 }

--------------------------------------------------------------------------------------

Result with post : ~~~~~~~~~~~~~~~~~~~~null
Result with get : ~~~~~~~~~~~~~~~~~~~~test=This+is+the+data


Please help me to resolve this.
[Message sent by forum member 'dushank']

http://forums.java.net/jive/thread.jspa?messageID=474095