This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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: 61106
    
  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)