This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

problem in passing form params in ajax call to a servlet

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bhavesh Sangwan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...




 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!