Note that there are some explanatory texts on larger screens.

plurals
  1. POTomcat gives 404 when i call my servlet
    text
    copied!<p>I can't access to my servlet i call with a form. I checked the arborescence, web.xml and the form, but i can't see any problem. I use Eclipse with a "web dynamic project".</p> <p>There is my arborescence :</p> <p><img src="https://i.stack.imgur.com/nyRnp.jpg" alt="enter image description here"></p> <p>My web.xml :</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt; &lt;display-name&gt;Z-ProjetJ2EE&lt;/display-name&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;description&gt;&lt;/description&gt; &lt;servlet-name&gt;CommandeServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;controleur.CommandeServlet&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;CommandeServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/urlCommandeServ&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>My form (i tried the complete url, but it didn't works) :</p> <pre><code>&lt;form action="/urlCommandeServ" method="post"&gt; </code></pre> <p>And my servlet :</p> <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String cat = request.getParameter("categorie"); Float prix = Float.parseFloat(request.getParameter("prix")); response.sendRedirect("CreerCommande?cat=" + cat+"&amp;prix="+prix); </code></pre> <p>I didn't have any error in eclipse, and the log folder in tomcat is empty. Could you help me ?</p> <p>EDIT:</p> <p>There is my error :</p> <p><img src="https://i.stack.imgur.com/gtWNe.jpg" alt="Error 404"></p> <p>I agree for responses about my error on response.sendRedirect, but this is not the real subject of my error :) Even if i erase all of my code on doPost, i have this error, instead of a white page.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload