• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about QueryString

 
Sundar Murthi
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers
i am tested the following servlet program.



What ever the form i am submiting to this servlet in post method i am always getting null in queryString. In Get method in geting proper query string.

I know the post method used for secure information transformation.

My query is in post method getQueryString() returns always null???
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getQueryString():
Returns the query string that is contained in the "request URL" after the path. This method returns null if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.

When you POST a form the name/value pairs are not part of the request URL.
 
Colin Fletcher
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sundar,

If you wanted to see the 'raw' data POST'd to the servlet, I would be inclined to use the getReader() or getInputStream.

There is a wealth of information in the HttpServletRequest object which I think you will find helpful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic