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