I am new to AJAX so I was testing my code on the tomcat server by using simple example..... But I am not sure where should I put all the files that have .html extension and where should I put .java file extension and where .class file..
In the WEB-INF/classes folder, my getname.java file and getname.class file is there.. am i doing ryt?
and my ajax.html file is in examples/servlets folder am i doing ryt??
so when I was testing my this code it is not working... everytime i get, error during ajax call...
This is my HTML Code.... saved as ajax.html,
and this is my getname.java file:-
please let me know what wrong I am doing and what other things i have to do.. like i have to add something in web.xml file or sever.xml file....??
It would also help to show us the error that you are getting. Otherwise, all we can do is to guess.
Please through the "smart questions" link in my signature.
Joined: Mar 23, 2010
am i doing right?
it means that whether I am doing right or not... Since i am not sure where should I put the files... so that's why I asked you...
And How can I show you the error.... I am not sure where should i look for that....
When I opened the page ajax.html....
it doesn't work... instead it shows an alert box message (Error During Ajax call.. Please try again) that I have set up in the Ajax.html page...
The servlet specification sets out how a web app needs to be laid out. There's also Tomcat documentation.
Joined: Mar 23, 2010
I placed the .html file here:-
and When I opened ajax.html page so when I click the submit button to test my AJAX Program... it was not working.. instead it shows an alert box that I have set up in ajax.html page...What I am trying to do.. I am calling servlet getname through the button click event in ajax.html page but when I tried to open the servlet directly...
I got these two error:-
Raihan Jamal wrote:As you said I was working with the servlet ryt now
"ryt" again? Please use real words when posting to the forums. Abbreviations such as "ryt" in place of "right" only serve to make your posts more difficult to read and less likely to generate useful responses.
If you directly send request to Servlet through direct access to the Servlet URL, it goes as GET request ... Since your servlet handles only POST request, you are getting this error... I think you can follow sriinu... Please check again...