Mouli
Mouli

Reputation: 129

how to get values from jsp

In my jsp am using file upload in the form of enctype="multipart/form-data" and get the form values in another jsp. am getting null value . plz...any one tell any solution....thanks in advance.. hear is my jsp coding

<html>
<head></head>
<body>
<form name="corporateProfile" method="POST"
 onsubmit="return checkTheFields();" action="editUpdate.jsp"
 enctype="multipart/form-data">
<table>
  <tr>
      <td class="bgcolor" align="right" valign="top" style="padding:3px">
          <b>Upload Customer Logo</b></td>
      <td colspan="3" class="bgcolor" align="left" valign="top"
           style="padding:3px">
          <input TYPE="file" VALUE="Browse" NAME="uploadCustomerLogo"
           maxlength="1000" size="40" class="controlStyle" tabindex="17">
      </td> 
  </tr>
  <tr>
      <td>
          <input type="text" name="email" id="email" size="40"
           class="controlStyle" maxlength="256" tabindex="11">
      </td>
  </tr>
</table>

</body>
</form>
</html>

editUpdate.jsp

<%
String params  = request.getParamater("email");
out.println(params);
%>

output gives

null

Upvotes: 0

Views: 12489

Answers (2)

Ryan Fernandes
Ryan Fernandes

Reputation: 8536

getParameter on a multipart form will return null. There are 4 solutions listed here.

Upvotes: 1

user467871
user467871

Reputation:

Give an id to the < form > tag

<form name="corporateProfile" id="corporateProfile"

and then try request.getParamater("email");

Upvotes: 0

Related Questions