title: HttpServletRequest get no parameters?
body: <p>I cannot get any parameter in a HttpServletRequest object using a form.</p>
  
  <p>My project is set to use Java6, and is a dynamic web project 2.5.</p>
  
  <p>The cod for the html page :</p>
  
  <pre><code>&lt;%@ page pageEncoding="UTF-8"%&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %&gt;
  &lt;!DOCTYPE html"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
      &lt;title&gt;Thesaurus Builder&lt;/title&gt;
      &lt;link type="text/css" rel="stylesheet" href="&lt;c:url value="/form.css"/&gt;" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="&lt;c:url value='/' /&gt;" method="post" accept-charset="UTF-8"&gt; &lt;!-- accept-charset="UTF-8" --&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Analyse de texte&lt;/legend&gt;
  
              &lt;label for="file"&gt;Fichier à analyser&lt;/label&gt;
              &lt;textarea rows="7" cols="100" name="file" id="file" &gt;&lt;/textarea&gt;
              &lt;br /&gt;
              &lt;br /&gt;
  
              &lt;label for="encoding"&gt;Encodage&lt;/label&gt;
              &lt;input type="text" id="encoding" name="encoding" value="UTF-8" /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
  
  
              &lt;br /&gt;
              &lt;label for="debug"&gt;Mode Debug&lt;/label&gt;
              &lt;input type="checkbox" id="debug" name="debug"/&gt;
              &lt;br /&gt;
              &lt;br /&gt;
  
              &lt;input type="submit" value="Envoyer" class="sansLabel" /&gt;
              &lt;br /&gt;                
          &lt;/fieldset&gt;
      &lt;/form&gt;
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>the servlet : </p>
  
  <pre><code>    package test2;
  
      import java.io.IOException;
      import java.util.Map;
      import java.util.Map.Entry;
  
      import javax.servlet.ServletException;
      import javax.servlet.http.HttpServlet;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;
  
      public class Tester extends HttpServlet{
  
          /**
           * 
           */
          private static final long serialVersionUID = 1L;
  
          public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
  
              this.getServletContext().getRequestDispatcher( "/WEB-INF/input.jsp" ).forward( request, response );
  
  
  
      }
  
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
  
          Map&lt;String,String&gt; map = request.getParameterMap();
          for(Entry&lt;String, String&gt; s : map.entrySet()){
              System.out.println(s.getKey() + " - "+ s.getValue());
          }
          this.getServletContext().getRequestDispatcher( "/WEB-INF/input.jsp" ).forward( request, response );
  
      }
    }
  </code></pre>
  
  <p>and the 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" 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;test2&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
  
    &lt;servlet&gt;
          &lt;servlet-name&gt;Tester&lt;/servlet-name&gt;
          &lt;servlet-class&gt;test2.Tester&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Tester&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/test&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/default.html&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/default.htm&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/index.html&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>The function in the servlet does'nt print anything.
  I am completly stuck here. Anybody know what to do?</p>