aspose file tools*
The moose likes Servlets and the fly likes [ajax and servlet] Servlet could not retrieve parameters from ajax xmlHttp.send(params) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "[ajax and servlet] Servlet could not retrieve parameters from ajax xmlHttp.send(params)" Watch "[ajax and servlet] Servlet could not retrieve parameters from ajax xmlHttp.send(params)" New topic
Author

[ajax and servlet] Servlet could not retrieve parameters from ajax xmlHttp.send(params)

wei liu
Ranch Hand

Joined: Nov 19, 2008
Posts: 35

hi eveyone,

I was trying to send parameters through xmlHttp.send(params) and process them in my servlet class.
However, I could not retrieve those parameters in the servlet class by using request.getParameter("paramName");

here is my code in javascripts(ajax part)


and here is the code in my servlet class



now I am able to get and display "hahaha" in my webpage ,but all the parameters returned are all nulls.


any comments will be grateful.

thanks very much in advance


SCJP 1.6 in 2010
SCWCD5 in 2011
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Use Firebug in Firefox to inspect the request that you are sending. Is it correct?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [ajax and servlet] Servlet could not retrieve parameters from ajax xmlHttp.send(params)