title: Eclipse - Java Issue finding the controller
body: <p>I am learning JSP through a French JSP book full of tutorials. I'm currently learning "MVC &amp; Jsp" basically, with a Catalog of DVD and a Shopping cart. A controller adds dvds to the cart when the user clicks on the add button.
  However, it appears that my controller isn't called. I place a System.Out when it is called to check if it works, and there is no text popping on my console...
  <strong>Here is my project explorer.</strong></p>
  
  <p><img src="https://i.stack.imgur.com/eLvfs.png" alt=""></p>
  
  <p><strong>And here are my codes for my catalog and my Controller.</strong></p>
  
  <pre><code>&lt;%@page import="exoLivres.ShoppingCart"%&gt;
  
  &lt;%@ page errorPage="../PagesErreur/Erreurpage.jsp" %&gt;
  &lt;jsp:useBean id="cart" scope="session" class="exoLivres.ShoppingCart" /&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Catalogue DVD&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;a href="U:/workspace/myfirstProject/WebContent/MVC/ShoppingCartMVC.jsp"&gt;Quantité actuelle : &lt;/a&gt; &lt;%=cart.getNumOfItems() %&gt;
      &lt;hr&gt;
          &lt;center&gt;&lt;h3&gt;Catalogue DVD&lt;/h3&gt;&lt;/center&gt;
          &lt;table border="1"&gt;
                  &lt;tr&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Prix&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;
              &lt;form action="ShopController" method="post"&gt;
  &lt;!--no error, but nothing happening--&gt;
                  &lt;td&gt;Frozen&lt;/td&gt;
                  &lt;td&gt;$19.95&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" name="Submit" value="Ajouter"&gt;&lt;/td&gt;
                  &lt;input type="hidden" name="id" value="1"&gt;
                  &lt;input type="hidden" name="desc" value="Frozen"&gt;
                  &lt;input type="hidden" name="price" value="19.95"&gt;
                  &lt;input type="hidden" name="command" value="add"&gt;
              &lt;/form&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;form action="ShopController" method="post"&gt;
  &lt;!--no error, but nothing happening--&gt;
                  &lt;td&gt;XMen Origins&lt;/td&gt;
                  &lt;td&gt;$19.95&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" name="Submit" value="Ajouter"&gt;&lt;/td&gt;
                  &lt;input type="hidden" name="id" value="1"&gt;
                  &lt;input type="hidden" name="desc" value="XMen"&gt;
                  &lt;input type="hidden" name="price" value="19.95"&gt;
                  &lt;input type="hidden" name="command" value="add"&gt;
          &lt;/form&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;form action="ShopController" method="post"&gt;
                  &lt;td&gt;Avengers&lt;/td&gt;
                  &lt;td&gt;$17.95&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" name="Submit" value="Ajouter"&gt;&lt;/td&gt;
                  &lt;input type="hidden" name="id" value="1"&gt;
                  &lt;input type="hidden" name="desc" value="Avengers"&gt;
                  &lt;input type="hidden" name="price" value="17.95"&gt;
                  &lt;input type="hidden" name="command" value="add"&gt;
              &lt;/form&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>and my controller</strong></p>
  
  <pre><code>package exoLivres;
  import javax.servlet.*;
  import javax.servlet.http.*;
  import java.util.*;
  import java.io.*;
  import exoLivres.ShoppingCart;
  
  
  public class ShopController extends HttpServlet {
  
      public void init(ServletConfig config) throws ServletException{
          super.init(config);
      }
  
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
          System.out.println("Contrôleur démarré");
          String command= request.getParameter("command");
          HttpSession session = request.getSession();
          ShoppingCart cart = (ShoppingCart)session.getAttribute("cart");
  
          if(command.equals("add")){
              String id = request.getParameter("id");
              if (id!=null){
                  System.out.println(id);
                  String desc = request.getParameter("desc");
                  Float price = new Float(request.getParameter("price"));
                  cart.addItem(id, desc, price.floatValue(), 1);
                  System.out.println(id + desc + price);
              }
          }
          response.sendRedirect("U:/workspace/myfirstProject/WebContent/MVC/Catalogue.jsp");
      }
      public String getServletInfo(){
          return "ShopController Information";
      }
  
  }
  </code></pre>
  
  <p>I guess the problem is from my references to my Controller but I can't think of the correct reference. Any help welcome =)</p>
  
  <p>EDIT
  Okay so here is my web.xmm [I also did the modifications suggered on my code above, and removed every "e" I wrote at the end of method (and not methode)]
          
      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        version="3.0"></p>
  
  <pre><code>  &lt;servlet&gt;
      &lt;servlet-name&gt;MyfirstServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;myfirstProject.MyfirstServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;MyfirstServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/first&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;Books&lt;/servlet-name&gt;
      &lt;servlet-class&gt;myfirstProject.BookServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Books&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/books&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
      &lt;servlet-name&gt;ShopController&lt;/servlet-name&gt;
      &lt;servlet-class&gt;exoLivres.ShopController&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;ShopController&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/ShopController&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  
  &lt;/web-app&gt;
  </code></pre>