1
我要上傳文件,而IAM試圖運行顯示消息文件上傳問題JSP
org.apache.jasper.JasperException: Exception in JSP: /RootSipResource.jsp:33
30: out.println("Cookies" + request.getCookies());
31:
32: DiskFileUpload upload=new DiskFileUpload();
33: List items=upload.parseRequest(request);
34: Iterator it=items.iterator();
35: while(it.hasNext())
36: {
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.ServletException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.RootSipResource_jsp._jspService(RootSipResource_jsp.java:577)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:768)
org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:323)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:341)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)
org.apache.jsp.RootSipResource_jsp._jspService(RootSipResource_jsp.java:91)
在JSP頁面的表單字段設置爲
<form name="frm" id="frmLoad" method="post" enctype="multipart/form-data">
isMultipart被打印成真(boolean isMultipart = FileUpload.isMultipartContent(request);)
`out.println("Content Type ="+request.getContentType());` is printed as null
我想你錯過了action屬性。
你能解釋一下嗎? – chinchu
你是指表單動作? – chinchu