title: 404 - My jsp cannot find servlet
body: <p>I would like to call my servlet from my jsp, and my server return with 404 error message. Could anybody help me please?</p>
  
  <p>JSP - regsiter.jsp :</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;link rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="container"&gt;
          &lt;h2&gt;Register&lt;/h2&gt;
          &lt;form method="post" action="RegisterUser"&gt;
              &lt;p&gt;
                  &lt;c:out value="${error}" /&gt;
              &lt;/p&gt;
  
              &lt;p&gt;
                  E-mail &lt;input type="text" name="email" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  Name &lt;input type="text" name="name" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  Password &lt;input type="password" name="password1" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  Password again &lt;input type="password" name="password2" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;input type="submit" value="Regsiter" /&gt;
              &lt;/p&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My Servlet: RegisterUser.java :</p>
  
  <pre><code>package services;
  
  import database.User;
  import database.UserProvider;
  import java.io.IOException;
  
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @WebServlet(name = "RegisterUser", urlPatterns = {"/RegisterUser"})
  public class RegisterUser extends HttpServlet {
  
  
      @Override
      protected void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
  
          String email = request.getParameter("email");
          String name = request.getParameter("name");
          String password1 = request.getParameter("password1");
          String password2 = request.getParameter("password2");
          UserProvider userProvider = new UserProvider();
  
  
          if (password1.equals(password2)) {
              userProvider.addUser(new User(email, name, password1));
               request.getRequestDispatcher(request.getContextPath() + "/forum.jsp").forward(request, response);
  
          } else {
              request.setAttribute("error", "Passwords don't match!");
              request.getRequestDispatcher("register.jsp").forward(request, response);
          }
      }
  
  
  }
  </code></pre>
  
  <p>My web.xml version is 3.1, so i did not use serlet-mapping.
  My javax.servlet-api version is 3.1.0. This is a maven project, so it is a dependency.</p>
  
  <p>I really appreciate help, because this problem a part of my essay to university. :D</p>
  
  <p>thanks a lot :)</p>