I cannot access my servlet, which I am calling using the form. I checked arborescence, web.xml and the form, but I don't see any problem. I am using Eclipse with a "web dynamic project".
There is my arborescence:

My web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>Z-ProjetJ2EE</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<servlet-name>CommandeServlet</servlet-name>
<servlet-class>controleur.CommandeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CommandeServlet</servlet-name>
<url-pattern>/urlCommandeServ</url-pattern>
</servlet-mapping>
</web-app>
My form (I tried the full url but it didn't work):
<form action="/urlCommandeServ" method="post">
And my servlet:
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+"&prix="+prix);
I had no errors in eclipse and the log folder in tomcat is empty. could you help me?
EDIT:
There is my mistake:

I agree to the answers about my error on response.sendRedirect, but this is not the real subject of my error :) Even if I delete all my code on doPost, I have this error, and not on the white page.
source
share