title: Processing form data with sling servlet
body: <p>I'm trying to create a simple html form that is processed with a sling servlet. It's a very
  basic form with a couple input fields and my java class is pretty straightforward. All I'm trying to do is log the values from the form in my error log. Instead simply nothing happens. I must be missing something small or just plain blind. </p>
  
  <p>Form html</p>
  
  <pre><code>&lt;form name="" method="POST" action="/apps/form"&gt;
   &lt;input id="firstName" type="text" name="firstName" /&gt;
   &lt;input id="phoneNumber" type="text" name="phoneNumber" /&gt;          
   &lt;input type="submit" name="submit" value="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Java Class</p>
  
  <pre><code>@Component(immediate=true, metatype=false, label="FORM SERVLET")
  
  @Properties({
  @Property(name="sling.servlet.methods", value={"POST"}),
  @Property(name="sling.servlet.paths", value={"/apps/form"}),
  @Property(name="sling.servlet.selectors", value={"form"}),
  @Property(name="sling.servlet.extensions", value={"html"})
  })
  
  public class FormServlet extends SlingSafeMethodsServlet {
  
      private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
  
      protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException
      {
  
      response.setContentType("text/html");
      PrintWriter out = response.getWriter();
  
      String name = request.getParameter("firstName");
      String phone = request.getParameter("phoneNumber");
  
      out.println(name);
      out.println(phone);
  
  log.error("the chat component is loaded first name" + name + phone);
  
  }
  </code></pre>
  
  <p>}</p>