Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Ajax request help

 
Ranch Hand
Posts: 34
Netbeans IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are the values on the servlet always null?

This is the javascript/ JQUERY AJAX WITH JSON

This is the servlet code


Any help would be greatly appreciate. Or any suggestions. I did something similar before and it worked. It really bugs me out.
 
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stamin Adrian wrote:Why are the values on the servlet always null?


I don't know what you mean by "value on the servlet".
 
Stamin Adrian
Ranch Hand
Posts: 34
Netbeans IDE Tomcat Server Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sending two values to the servlet. Id and category. I select them from the view, and they are good. But the request.getAttribute() returns nulls.
 
Bear Bibeault
Marshal
Posts: 67445
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps getAttribute() isn't the right method to use?


Hint: it's not.
 
Replace the word "snake" with "danger noodle" in all tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic