I'm trying to send mail using form via the JavaMail API. I have created a simple jsp page with my servlet class as the form action, a java class as the Model. However each time I run the Jsp page to test, it shows a 404 page, saying requested resource not available when I click the "Submit" button on the form instead of redirecting to servlet.
I thought this could be a servlet mapping problem so I manually registered the servlet in a web.xml file I created in NetBeans but it's still not working.
The code in the servlet class is:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>mailservlet</display-name>
<description>
</description>
<servlet>
<servlet-name>mailservlet</servlet-name>
<servlet-class></servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>mailservlet</servlet-name>
<url-pattern>/mailservlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
mailservlet is the name of the servlet class.
Any suggestions on what else to do would be appreciated.