This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes executing Servlet using AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "executing Servlet using AJAX" Watch "executing Servlet using AJAX" New topic
Author

executing Servlet using AJAX

Kaushal Pandya
Greenhorn

Joined: Feb 15, 2006
Posts: 9
Hi friend,

currently i am in urgent need of a solution for my problem which I am facing since last one week. My requirement is, I have three drop down menus these menus are inter-related. when I selects first one, second one should automatically get populated upon the value selected in first one. same for thired one too... it depands upone the selected value in first and second.

I tried AJAX for this. but I am not able to execute servlet file for the same. I am getting AJAX status=404 that is 'Page Not Found' error. I did everything possible to overcome. I set the classpath exclusivly for the location where this file is located. File is located on <root drive>:\tomcat\webapps\<Application Name>\Activities\AJAXGetSelect.java

Please find the code....



and the servlet is AJAXGetSelect.java



Please provide me a fisible solution as soon as possible....

I am waiting guys...



Regards,
Kaushal Pandya
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
404 that is 'Page Not Found' error.


Your AJAX request is not using a URL that maps to a servlet or any other resource, its that simple.

Take the URL string and paste it in a browser, if it gets a 404 then you have to change either the URL or the way the server maps the url to a servlet.

Classpath has nothing to do with it



Did you expect something magic to happen here?

I think you better step away from this project and get a simple servlet working first, learn how web.xml works to map servlets to urls. Then you might get somewhere.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: executing Servlet using AJAX