title: JSP/Servlet can't get text from textarea
body: <p>I'm trying to upload to a database a photo with a description. Basically I've managed to upload the photo, but the description (comment) is always set as null.</p>
  
  <p>index.jsp contains a form with a file input and a textarea</p>
  
  <pre><code>&lt;textarea class="form-control" rows="2" id="comment" name="comment" placeholder="Write something"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>Servlet code:</p>
  
  <pre><code>@Override
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      String comment = request.getParameter("comment");
  
      if(ServletFileUpload.isMultipartContent(request)){
          try {
  
              List&lt;FileItem&gt; multiparts = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
  
              for(FileItem item : multiparts){
                  if(!item.isFormField()){
                      String name = new File(item.getName()).getName();
                      item.write( new File(UPLOAD_DIRECTORY + File.separator + name));
                      // till now, the photo is being saved in a folder
                      // method addPhoto uploads this photo in database
                      // this method works OK
                      addPhoto((int) request.getSession().getAttribute("id"), UPLOAD_DIRECTORY + File.separator + name , comment);
                  }
              }
  
             request.setAttribute("message", "File Uploaded Successfully");
          } catch (Exception ex) {
             request.setAttribute("message", "File Upload Failed due to " + ex);
          }          
      }
      request.getRequestDispatcher("/index.jsp").forward(request, response);
  }
  </code></pre>
  
  <p>If anyone could help me, how can I set the description of photo in database?</p>