I have created a hidden form element
<form name="UploadImage" enctype="multipart/form-data" method="post" action="UploadImage">
<label>
</label>
<input name="imgUploadObjId" id="imgUploadObjId" value="52" type="hidden">
//rest of the form here
</form>
And I am trying to get the value with this line in a servlet (as I have done before):
int objId = Integer.parseInt(request.getParameter("imgUploadObjId"));
But I get this (line 33 is the line above):
java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source) java.lang.Integer.parseInt(Unknown Source) web.objects.UploadImage.doPost(UploadImage.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Is there something different about a form with enctype="multipart/form-data"? Or can you see some other error.