I used eclipse and developed a servlet application in which jQuery uses ajax and calls the doPost method of servlet by passing parameters.
The application was wokring perfectly in eclipse IDE on Apache Tomcat 7 server.
Now I need to run this on another server where I need to integrate this with other java files. So I copied all the file along with web.xml file and tried to run on the other server.
But now the ajax call is unable to reach the servlet doPost method and hence throwing 404 error.
Please anyone help me regarding this and let me know what is the reason for this problem.
the simpleServer is the context path of my servlet
here is my servlet code
and this is my web.xml file
Please help me regarding this.
Thank you very much.
Can you post the URLs here which are being hit by the ajax call ? Post both the URLs, from within Eclipse and also the one from the external server that you deployed the application to .
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Anup Nadig Malathesha
posted 7 years ago
@Saif : Thank you very much for your response. I am using same URL in both ajax calls. the servlet class name is simpleServer.java and its url mapping is simpleServer. Hence I am using simpleServer as url in both the ajax calls. Please let me know if you need any details.
Thank you very much Bear.
So I heard that we need to depoly project in the server using war file. But I just copied and pasted these files in the server. won't it be problem. And also do I need to change my url mapping variable in web.xml file.