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.
精彩评论