aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes problem in passing form params in ajax call to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem in passing form params in ajax call to a servlet" Watch "problem in passing form params in ajax call to a servlet" New topic
Author

problem in passing form params in ajax call to a servlet

Bhavesh Sangwan
Ranch Hand

Joined: Aug 08, 2012
Posts: 57
Hi Experts .. ! I'm facing to send login params to a servlet using ajax call....

my code is listed below ....

sorry in advance for any stuppidity... actually i'm new to ajax..

so please guide some trics related to this problem....


Thanks....

ajax.js


form.html


When I make request then servlet does,t accept any request args.... I know that I'm doing something wrong... please correct my approach...
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 296
    
    5

You're not sending any request args, why are you expecting to receive any? If you want to do a POST of form data with AJAX then there's a lot of work to be done. Often easier to append the variables to the query string in a GET request, or just use a library which handles the details for you like jQuery.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
Bhavesh Sangwan
Ranch Hand

Joined: Aug 08, 2012
Posts: 57
Hi ! Problem again...

Actually when I send ajax request without params ,, then it is working fine...

but when I send some request with params then no data is sent to servlet and either no response is generated by the ajax response....

why please explain....

code is here.....

ajax code...



in above ajax code, params is javascript variable in string which i'm trying to send to the server.... but not sent and nor response is coming from servlet..

what to do....

Html file...




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in passing form params in ajax call to a servlet