title: How to retrieve text box value from a JSP page
body: <p>I am creating a web application in Java and am having trouble retrieving a value from a text box. My aim is to ask the user to enter their email address and then use the value entered for the rest of my application. I do this by attempting to pass the value as part of the URL in the jsp file (and retrieve it using request.getParameter()).
  However, the value that I keep retrieving is null.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
  &lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;Display file upload form to the user&lt;/TITLE&gt;
  &lt;/HEAD&gt;
  
          &lt;center&gt;
                  &lt;label for="email"&gt;Enter email address&lt;/label&gt;
                  &lt;input id="email" name="email"&gt;
  
          &lt;/center&gt;
  
  &lt;% String mail = request.getParameter("email");
                          System.out.println(mail);%&gt;
  &lt;BODY&gt;
      &lt;FORM ENCTYPE="multipart/form-data" ACTION="upload.jsp?e=&lt;%=mail%&gt;" METHOD=POST&gt;
          &lt;br&gt; &lt;br&gt; &lt;br&gt;
  
          &lt;center&gt;
              &lt;table border="0" bgcolor=#ccFDDEE&gt;
                  &lt;tr&gt;
                      &lt;center&gt;
                          &lt;td colspan="2" align="center"&gt;&lt;B&gt;UPLOAD THE FILE&lt;/B&gt;
                              &lt;center&gt;&lt;/td&gt; 
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2" align="center"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;b&gt;Choose the WebEx File To Upload and Convert:&lt;/b&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;INPUT NAME="file" TYPE="file"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2" align="center"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2" align="center"&gt;&lt;input type="submit"
                          value="Upload and Convert Recording"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;table&gt;
                      &lt;/center&gt;
                      &lt;/FORM&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>I am trying to pass the mail value into the jsp file so that I can use it in my application</p>