I have servlet of registration.
@WebServlet("/register")
public class RegisterServlet extends HttpServlet {
...
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("in servlet");
}
}
If I go to that page I get
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
Apache Tomcat/8.0.36
If I change @WebServlet("/register") in @WebServlet("/register1") all works correctly. How do I fix this situation?
web.xml
<?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"
version="3.1">
<display-name>booker</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>pages/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>
<context-param>
<param-name>controllers</param-name>
<param-value>com.epam.task.controller</param-value>
</context-param>
<session-config>
<session-timeout>-1</session-timeout>
</session-config>
</web-app>