HTML代码:
<form action="test" method="post">
Select files: <input type="file" id="myfiles" name="myfiles" multiple>
<input type="submit">
</form>
Servlet代码:
@WebServlet("/test")
@MultipartConfig
public class test extends HttpServlet {
List < FileItem > multiparts = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
}
错误:
httpservletrequest无法转换为requestcontext
答案 0 :(得分:0)
您enctype
中的<form>
<form action="test" method="post" enctype="multipart/form-data">