2
我在我的index.jsp使用此:JSP的request.getParameter(串)返回null
<FORM enctype="multipart/form-data" action="saveFile.jsp" method="POST">
Choose the file To Upload:<br>
<INPUT name="Filename" placeholder="Name to give your file"/>
<INPUT name="File" type="file" accept ="image/jpeg"/>
<INPUT TYPE="submit" VALUE="Send File" />
</FORM>
在saveFile.jsp字符串名称应使用的request.getParameter获得从输入字段中的值(“文件名”),但它返回的值为空;
String name = request.getParameter("Filename");
我知道请求被发送,因为该文件传递给我,但我无法弄清楚为什么我的代码部分失败。
请看看该职位:http://stackoverflow.com/questions/1545717/issue -with-多形式的数据 – 2013-03-11 13:55:44
谢谢它给了我一直在寻找的答案,请把它作为一个答案,所以我可以接受它 – 2013-03-12 14:42:51
THX非常多。完成... – 2013-03-12 14:59:46