Re: Re: Aw: Re: Aw: File Upload Failure in Struts 7.0.3 Migration - UploadedFilesAware Implementation Issue

2025-05-12 Thread Jesus Moreno
Sure, it’s so rare but I have been reading the log but I don’t find any hint. 
Maybe I could test with another version of tomcat or spring boot or without 
spring boot. I am thinking the problem is there.

Thanks, I’ll try it and tell you if it works.

Thanks
On 12 May 2025 at 11:16:41 AM -0600, [email protected], wrote:
> My configuration:
> Wildfly 33
> Eclipse as IDE
>
> I suppose you have already Struts DevMode.
> Sometimes a warning gives me a hint.
>
> Gesendet mit der mobilen Mail App
>
> Am 12.05.25 um 18:24 schrieb Jesus Moreno
>
> > Thanks to clarifying my question.
> >
> > I am thinking that the problem could be:
> >
> > • Apache Tomcat 10.1.3
> > • Spring Boot 3.4.4
> > • or my IDE when I am creating the war
> >
> > For your example, are you using tomcat and Spring Boot? If it is yes, what 
> > version?
> >
> > Thanks for the assistance.
> >
> > Regards
> > On 12 May 2025 at 8:43:31 AM -0600, Ute Kaiser , 
> > wrote:
> > > I am also sorry because I can not see the difference why my upload is 
> > > working and yours is not.
> > >
> > > Best regards
> > > Ute
> > >
> > > > Gesendet: Samstag, 10. Mai 2025 um 18:45
> > > > Von: "Jesus Moreno" 
> > > > An: [email protected], "Struts Users Mailing List" 
> > > > 
> > > > Betreff: Re: Aw: File Upload Failure in Struts 7.0.3 Migration - 
> > > > UploadedFilesAware Implementation Issue
> > > >
> > > > Ohh sorry about my current configuration that I shared but I was trying 
> > > > many options. First I was trying exactly refer to the documentation but 
> > > > I did not have success.
> > > >
> > > > 1. According to the docs, it’s unnecessary put interceptor refer again, 
> > > > because defaultStack consider use actionFileUpload interceptor but I 
> > > > referred manually. (I suppose that is necessary but I was trying 
> > > > without both refers, actionFileUpload and defaultStack and nothing)
> > > > 2. Mi jsp looks like this:
> > > >
> > > > 
> > > > 
> > > > Upload
> > > > 
> > > >
> > > >      3.  As you can see first I am trying to test a basic example 
> > > > because I’d like to understand how do I upload a file in the new 
> > > > version because I am migrating an app.
> > > >
> > > > Finally I did not understand if you had success to upload a file to the 
> > > > server. It is true?
> > > >
> > > > That’s why I ask for your support.
> > > >
> > > > I appreciate your assistance.
> > > >
> > > > Regards
> > > > On 10 May 2025 at 2:57:02 AM -0600, Ute Kaiser , 
> > > > wrote:
> > > > > Hi,
> > > > >
> > > > > I tried the same last week for the first time, and here is my 
> > > > > experience:
> > > > > 1.
> > > > > WARN [org.apache.struts2.components.File] (default task-5) Struts has 
> > > > > detected a file upload UI tag (s:file) being used without a form set 
> > > > > to method 'POST'. This is probably an error!
> > > > > I used  and it was rendered automatically to method=post but 
> > > > > to get rid of the warning I had to set it manually
> > > > > 
> > > > > 2.
> > > > > MyAction.java looks pretty much the same as your HelloAction.java.
> > > > > But it helped me to use "newLogo" instead of "upload" in jsp and 
> > > > > action class.
> > > > > 3.
> > > > > I did not use any of your struts.xml configuration.
> > > > > a)
> > > > > 
> > > > > 
> > > > > I think "actionFileUplad" is enclosed in the "defaultStack".
> > > > > I do not know about this "basicStack" you copied from the 
> > > > > documentation example.
> > > > > b)
> > > > > 
> > > > >  
> > > > >  
> > > > > Your saveDir looks strange to me.
> > > > > I use the default saveDir which turned out as a Wildfly tmp 
> > > > > directory, and then save to my targetPath with:
> > > > > Files.copy( ( (File) newLogo.getContent() ).toPath(), targetPath, 
> > > > > StandardCopyOption.REPLACE_EXISTING );
> > > > > 4.
> > > > > You did not give much info on your jsp.
> > > > > Here is my part: 
> > > > >
> > > > > Perhaps you can strip down with less struts.xml configuration to find 
> > > > > a solution to your problem.
> > > > > Good luck
> > > > > Ute
> > > > >
> > > > >
> > > > > > Gesendet: Samstag, 10. Mai 2025 um 05:42
> > > > > > Von: "Jesus Moreno" 
> > > > > > An: [email protected]
> > > > > > Betreff: File Upload Failure in Struts 7.0.3 Migration - 
> > > > > > UploadedFilesAware Implementation Issue
> > > > > >
> > > > > > I'm migrating an application from Struts 2.5 to 7.0.3 and 
> > > > > > encountering
> > > > > > persistent issues with file upload functionality despite following 
> > > > > > the
> > > > > > documentation.
> > > > > >
> > > > > > The UploadedFile object remains null in my action class, even with:
> > > > > >
> > > > > > - Correct UploadedFilesAware implementation
> > > > > > - Proper multipart form configuration
> > > > > > - Debug logs showing no uploaded files (ActionFileUploadInterceptor 
> > > > > > reports
> > > > > > empty acceptedFiles)
> > > > > >
> > > > > > Logs show:
> > > > > >
> > > > > > 2025-05-09 01:00:25 DEBUG ActionFileUploadI

Re: Re: Aw: Re: Aw: File Upload Failure in Struts 7.0.3 Migration - UploadedFilesAware Implementation Issue

2025-05-12 Thread utkai
My configuration:
Wildfly 33
Eclipse as IDE

I suppose you have already Struts DevMode. 
Sometimes a warning gives me a hint. 

Gesendet mit der mobilen Mail App

Am 12.05.25 um 18:24 schrieb Jesus Moreno

> Thanks to clarifying my question.
> 
> I am thinking that the problem could be:
> 
> • Apache Tomcat 10.1.3
> • Spring Boot 3.4.4
> • or my IDE when I am creating the war
> 
> For your example, are you using tomcat and Spring Boot? If it is yes, what 
> version?
> 
> Thanks for the assistance.
> 
> Regards
> On 12 May 2025 at 8:43:31 AM -0600, Ute Kaiser , wrote:
> > I am also sorry because I can not see the difference why my upload is 
> > working and yours is not.
> >
> > Best regards
> > Ute
> >
> > > Gesendet: Samstag, 10. Mai 2025 um 18:45
> > > Von: "Jesus Moreno" 
> > > An: [email protected], "Struts Users Mailing List" 
> > > 
> > > Betreff: Re: Aw: File Upload Failure in Struts 7.0.3 Migration - 
> > > UploadedFilesAware Implementation Issue
> > >
> > > Ohh sorry about my current configuration that I shared but I was trying 
> > > many options. First I was trying exactly refer to the documentation but I 
> > > did not have success.
> > >
> > > 1. According to the docs, it’s unnecessary put interceptor refer again, 
> > > because defaultStack consider use actionFileUpload interceptor but I 
> > > referred manually. (I suppose that is necessary but I was trying without 
> > > both refers, actionFileUpload and defaultStack and nothing)
> > > 2. Mi jsp looks like this:
> > >
> > > 
> > > 
> > > Upload
> > > 
> > >
> > >      3.  As you can see first I am trying to test a basic example because 
> > > I’d like to understand how do I upload a file in the new version because 
> > > I am migrating an app.
> > >
> > > Finally I did not understand if you had success to upload a file to the 
> > > server. It is true?
> > >
> > > That’s why I ask for your support.
> > >
> > > I appreciate your assistance.
> > >
> > > Regards
> > > On 10 May 2025 at 2:57:02 AM -0600, Ute Kaiser , 
> > > wrote:
> > > > Hi,
> > > >
> > > > I tried the same last week for the first time, and here is my 
> > > > experience:
> > > > 1.
> > > > WARN [org.apache.struts2.components.File] (default task-5) Struts has 
> > > > detected a file upload UI tag (s:file) being used without a form set to 
> > > > method 'POST'. This is probably an error!
> > > > I used  and it was rendered automatically to method=post but to 
> > > > get rid of the warning I had to set it manually
> > > > 
> > > > 2.
> > > > MyAction.java looks pretty much the same as your HelloAction.java.
> > > > But it helped me to use "newLogo" instead of "upload" in jsp and action 
> > > > class.
> > > > 3.
> > > > I did not use any of your struts.xml configuration.
> > > > a)
> > > > 
> > > > 
> > > > I think "actionFileUplad" is enclosed in the "defaultStack".
> > > > I do not know about this "basicStack" you copied from the documentation 
> > > > example.
> > > > b)
> > > > 
> > > >  
> > > >  
> > > > Your saveDir looks strange to me.
> > > > I use the default saveDir which turned out as a Wildfly tmp directory, 
> > > > and then save to my targetPath with:
> > > > Files.copy( ( (File) newLogo.getContent() ).toPath(), targetPath, 
> > > > StandardCopyOption.REPLACE_EXISTING );
> > > > 4.
> > > > You did not give much info on your jsp.
> > > > Here is my part: 
> > > >
> > > > Perhaps you can strip down with less struts.xml configuration to find a 
> > > > solution to your problem.
> > > > Good luck
> > > > Ute
> > > >
> > > >
> > > > > Gesendet: Samstag, 10. Mai 2025 um 05:42
> > > > > Von: "Jesus Moreno" 
> > > > > An: [email protected]
> > > > > Betreff: File Upload Failure in Struts 7.0.3 Migration - 
> > > > > UploadedFilesAware Implementation Issue
> > > > >
> > > > > I'm migrating an application from Struts 2.5 to 7.0.3 and encountering
> > > > > persistent issues with file upload functionality despite following the
> > > > > documentation.
> > > > >
> > > > > The UploadedFile object remains null in my action class, even with:
> > > > >
> > > > > - Correct UploadedFilesAware implementation
> > > > > - Proper multipart form configuration
> > > > > - Debug logs showing no uploaded files (ActionFileUploadInterceptor 
> > > > > reports
> > > > > empty acceptedFiles)
> > > > >
> > > > > Logs show:
> > > > >
> > > > > 2025-05-09 01:00:25 DEBUG ActionFileUploadInterceptor:179 - No files 
> > > > > have
> > > > > been uploaded/accepted
> > > > > 2025-05-09 01:00:25 WARN File:79 - Struts has detected a file upload 
> > > > > UI tag
> > > > > (s:file) being used without a form set to method 'POST'
> > > > > (Despite  being
> > > > > correctly declared)
> > > > >
> > > > > Basic action:
> > > > > // Action
> > > > > public class HelloAction extends ActionSupport implements
> > > > > UploadedFilesAware {
> > > > > public UploadedFile upload; // Always null
> > > > >
> > > > > @Override
> > > > > public String execute() {
> > > > > //do something with the file
> >