Basically I am trying to map a servlet to my web.xml but it's not working.
Here is how i am doing it:
Project directory:
C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT
FYI: I have removed all apache default webapp files and have putted my own project, so it could be accessed with just localhost
which works fine.
My servlet location in my drive:
C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT\src\duck\reg\pack\userlogin.java
My package in eclipse IDE: package in eclipse IDE Image
and my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>ROOT</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>userlogin</servlet-name>
<servlet-class>duck.reg.pack.userlogin</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>userlogin</servlet-name>
<url-pattern>/ROOT/WebContent/src</url-pattern>
</servlet-mapping>
</web-app>
My HTML Form:
<form method="POST" action="/ROOT/WebContent/src" autocomplete="off">
.../ code
</form>
I don't know why but this doesn't works, and I am not running apache through Ecplise
Thanks for all replies:)