Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 675

Tomcat giving 404 error with servlets

$
0
0

I have developed a Java web application using Tomcat 7 and Oracle JDK 1.7 with NeatBeans 7.3. My application runs on my local pc without any errors.

But after i hosted my application, I can't access servlets. It is giving me 404 error. I'm not used web.xml in my application to map servlets. I used annotation for it.

Hosted server use Tomcat 7 and Open JDK 1.7.

What could be the issue ? How can i solve this ?

New Update

The place where i have purchased hosting gave me cPanel to upload files. There is no place to upload war file or place to upload files in to webapps director in tomcat. so i uploaded files in to public_html directory. i think this may be the issue. because when i'm trying to access servlet like www.mysite.com/A , server search for this in root directoy. but acctually it is not there. so it gives 404 error.

I thnik this may be the issue. Any suggesions ?

UPDATED

Annotation is like below

@WebServlet(name = "AddCustomer", urlPatterns = {"/AddCustomer"})

Download Servlet from DropBox.

Directory structure.

img


Viewing all articles
Browse latest Browse all 675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>