title: request.getParameter on a submit button giving null value
body: <p>On click of Generate PDF/Generate Excel submit button it is requesting the servlet <strong>FileUpload</strong> to do the processing.Now when I am trying to get the value of the submit button that i have pressed,it is giving me the value as <strong>null</strong>.I wonder why is it happening?</p>
  
  <p>Here is my HTML code:</p>
  
  <pre><code>&lt;form action="FileUpload" method="post" enctype="multipart/form-data"&gt;
  &lt;input type="file" id="filename" name="filename"&gt;&lt;br&gt;
  &lt;input type="button" value="Upload"&gt;&lt;br&gt;
  &lt;input type="submit"  value= "Generate PDF" name="pdf"&gt;
  &lt;input type = "submit" value="Generate Excel" name="xls"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my servlet code:</p>
  
  <pre><code>String generatePDF= request.getParameter("pdf");//null
  if(generatePDF.equals("Generate PDF"))//Giving NullPointerException at this step
  {
    System.out.println("generatePDF button pressed");
  }
  </code></pre>