I am trying to deploy a simple web application. I only have 2 files, Entry.html and UpdateDBServlet. I have placed them under a directory in the webapps of tomcat. I can access the entry.html when Tomcat is running, but upon pressing the submit button, the UpdateDBServlet should be called, however, I get a html 404 error indicating that the requested resource is unavailable. I dont know how else to place this resource. Should this servlet also be mapped in the web.xml file?
raghujosh 0 Junior Poster
Recommended Answers
Jump to PostYour server cannot find your Java class that should be inside PROEJCT_FOLDER/WEB-INF/classes. For more details on project folder structure check Tomcat documentation here
Jump to Post1. Your HTML is wrong. Form tags should encapsulate fields you want to retrieve
2. If you post also Java class and web.xml file I may try to run it and see where is problem
Jump to Post@raghujosh sorry for late reply. To solve 404 that you had originally you need to included mapping for your servlet. Just add mapping as showed bellow and you are sorted. You will need to go back to your original folder layout
<servlet> <servlet-name>UpdateDBServlet</servlet-name> <servlet-class>UpdateDBServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>UpdateDBServlet</servlet-name> …
All 11 Replies
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
ph03nix 0 Newbie Poster
raghujosh 0 Junior Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
raghujosh 0 Junior Poster
mohammed2raja 0 Light Poster
raghujosh 0 Junior Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
raghujosh 0 Junior Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
raghujosh 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.