The best practice to retrieve HTML form fields in Servlet is to use apache commons-fileupload 1.3 jar.
Using iterator iterate through multipart HTTPServletRequest and use a for loop to check if it isFormField(), then
String item1=null,item2=null,item3=null;
if(item.isFormField())
{
if(item.getFieldName().equals("field1"))
{
item1=item.getString();
}
if(item.getFieldName().equals("field2"))
{
item2=item.getString();
}
if(item.getFieldName().equals("field3"))
{
item3=item.getString();
}
}
and your HTML file should be like this
<html>
<body>
<form action="servletname" method="post" enctype="multipart/form-data">
<input type="text" name="field1">
<input type="text" name="field2">
<input type="text" name="field3">
<input type="file" name="filetoupload">
<input type="submit" value="Upload">
</form>
</body>
</html>