开发者

Issue with Servlet Multipart request

开发者 https://www.devze.com 2023-03-26 17:40 出处:网络
I follow this tutorial to parse multipart request. To this code in first line I add String user = request.getParameter(\"username\");

I follow this tutorial to parse multipart request. To this code in first line I add

String user = request.getParameter("username");

But my code stop working after that. How can 开发者_运维知识库I parse the request.


request.getParameter("username"); implies that you are trying to read a form field. In that event, you must read the request parameter and it's value using FileItem.getFieldName() and FileItem.getString methods.

HttpServletRequest.getParameter will not work in such an event, since it is meant to be used to process URL-encoded data in the query string or in the POST body.

0

精彩评论

暂无评论...
验证码 换一张
取 消