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.
Here is my code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>Display file upload form to the user</TITLE> </HEAD> <center> <label for="email">Enter email address</label> <input id="email" name="email"> </center> <% String mail = request.getParameter("email"); System.out.println(mail);%> <BODY> <FORM ENCTYPE="multipart/form-data" ACTION="upload.jsp?e=<%=mail%>" METHOD=POST> <br> <br> <br> <center> <table border="0" bgcolor=#ccFDDEE> <tr> <center> <td colspan="2" align="center"><B>UPLOAD THE FILE</B> <center></td> </tr> <tr> <td colspan="2" align="center"></td> </tr> <tr> <td><b>Choose the WebEx File To Upload and Convert:</b></td> <td><INPUT NAME="file" TYPE="file"></td> </tr> <tr> <td colspan="2" align="center"></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Upload and Convert Recording"></td> </tr> <table> </center> </FORM> </BODY> </HTML> I am trying to pass the mail value into the jsp file so that I can use it in my application