I recently upgraded from Tomcat 10.0.17 to 10.1.13.  When I previously upgraded
from 9.0.41 to 10.0.17 (back in 2/22) the FileUpload class broke. I fixed that
thanks to postings on stackoverflow, but now that I've
upgraded to 10.1.13 it is broken again! Here's the error I get:

An error occurred at line: [40] in the jsp file: [/schDistImportResults.jsp]
The method isMultipartContent(ServletRequestContext) is undefined for the type 
FileUpload

39: 
40: boolean isMultipart = FileUpload.isMultipartContent(new 
ServletRequestContext(request));
41: 
>
An error occurred at line: [133] in the jsp file: [/schDistImportResults.jsp]
ServletFileUpload cannot be resolved to a type

131: 
132: DiskFileItemFactory factory = new DiskFileItemFactory();   // Create a 
factory for disk-based file items
133: ServletFileUpload upload = new ServletFileUpload(factory); // Create a new 
file upload handler
134: List items = upload.parseRequest(new ServletRequestContext(request));      
           // Parse the request
135: Iterator iter = items.iterator();                          // Process the 
uploaded items
136: FileItem item = null;

I've checked the RELEASE-NOTES, FAQ and searched the web.  I've checked the
UploadFile class (no clue) and looked for examples, but none resembled my app. 
I tried reverting back to the program version I had with 9.0.41, but that didn't
work. 

Here is all I changed in the program between Tomcat versions 9.0.41 and 10.0.17 
(which worked):
Code:

26,28c26,28
< <%@ page import="org.apache.commons.fileupload.*,
<     org.apache.commons.fileupload.disk.*,
<     org.apache.commons.fileupload.servlet.*,
---
> <%@ page import="org.apache.tomcat.util.http.fileupload.*,
>     org.apache.tomcat.util.http.fileupload.disk.*,
>     org.apache.tomcat.util.http.fileupload.servlet.*,
40c40
< boolean isMultipart = FileUpload.isMultipartContent(request);
---
> boolean isMultipart = FileUpload.isMultipartContent(new 
> ServletRequestContext(request));
134c134
< List items = upload.parseRequest(request);                 // Parse the 
request
---
> List items = upload.parseRequest(new ServletRequestContext(request));         
>         // Parse the request

I have quite a few programs that use the FileUpload methods. Does anyone know 
how to fix this latest breakage?

Thanks --Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to