从jsp页面上传文件时。 request.getContentType()和String type1 = req.getHeader(" Content-Type")返回空值。
Jsp代码:
<FORM action="/UploadServlet" method="post" enctype="multipart/form-data">
<INPUT type="file" name="name_of_files">
<INPUT type="submit" name="Submit" value="Submit">
</FORM>