I have an HTML form in a JSP file in my
WebContent/jsps folder. I have a servlet class
servlet.java in my default package in
src folder. In my
web.xml it is mapped as
I have tried several URLs in
action attribute of the HTML form:
But none of those work. They all keep returning a HTTP 404 error like below in Tomcat 6/7/8:
HTTP Status 404 — /servlet
Description: The requested resource (/servlet) is not available.
Or as below in Tomcat 8.5/9:
HTTP Status 404 — Not Found
Description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
Why is it not working?