[ 
https://issues.apache.org/jira/browse/WW-5388?focusedWorklogId=902423&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-902423
 ]

ASF GitHub Bot logged work on WW-5388:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Jan/24 21:07
            Start Date: 29/Jan/24 21:07
    Worklog Time Spent: 10m 
      Work Description: burtonrhodes commented on PR #861:
URL: https://github.com/apache/struts/pull/861#issuecomment-1915569409

   Just FYI, I implemented this PR on a small subset of my server cluster and 
have been receiving the following ambiguous errors in some of the upload 
requests.  I can't duplicate it in any testing environment, but curious if you 
might have a clue as to why Struts is creating an actionError with no value for 
the file.  For this implementation, I am **_not_** using the stream parser
   
   _Error printed by the code below_
   
   ```
   Unidentified ActionError present for file upload: [Error uploading: {0}!, 
Error uploading: {0}!]
   ```
   
   _Code that quickly checks for any file upload errors_
   
   ```
   if (hasActionErrors()) {
       List<String> uploadErrors = (List<String>) getActionErrors();
       log.error("Unidentified ActionError present for file upload: " + 
uploadErrors);
   }
   ```
   
   _A redacted version of the action_
   
   
   ```
   public class UploadLocalFileJsonAction extends ActionSupport implements 
Validateable, UploadedFilesAware<UploadedFile<File>> {
   
       private FileAttachmentUpload fileAttachmentUpload;
   
       @Override
       public void withUploadedFiles(List<UploadedFile<UploadedFile<File>>> 
uploadedFiles) {
           if (!uploadedFiles.isEmpty()) {
               fileAttachmentUpload = 
UploadedFileHelper.createFromUploadedFile(uploadedFiles.get(0));
           }
       }
   
       public void validate() {
           // First check to see if there are any errors from the file upload
           if (hasActionErrors()) {
               List<String> uploadErrors = (List<String>) getActionErrors();
               log.error("Unidentified ActionError present for file upload: " + 
uploadErrors);
           }
       }
   
       public String execute() throws Exception {
           // Omitted for brevity
       }
   }
   ```
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 902423)
    Time Spent: 7h 50m  (was: 7h 40m)

> Upgrade Commons Fileupload to FileUpload Jakarta Servlet 6
> ----------------------------------------------------------
>
>                 Key: WW-5388
>                 URL: https://issues.apache.org/jira/browse/WW-5388
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.0.0
>
>          Time Spent: 7h 50m
>  Remaining Estimate: 0h
>
> There is a new version of JakartaEE FileUpload
> {code:xml}
> <dependency>
>   <groupId>org.apache.commons</groupId>
>   <artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
>   <version>2.0.0-M2</version>
> </dependency>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to