Re: [EXTERNAL] Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi Noel, Could you start a new thread? Messing up with different topics won't help :) Cheers Lukasz pt., 12 sty 2024 o 13:59 napisał(a): > > Hi, > > Need help. > > We use struts 2.5.25 with Tiles 3. > > We migrated struts 2.5.25 to struts 6.3.0.2, we hit error, see below, log > from websphere app server version 9.0.5. > > [1/11/24 12:02:32:792 EST] 00f4 ServletWrappe E > com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught > service() exception root cause /cris/template/template.jsp: > com.ibm.websphere.servlet.error.ServletErrorReport: > java.lang.NoSuchMethodError: > org/apache/tiles/template/InsertAttributeModel.execute(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/apache/tiles/Attribute;ZLorg/apache/tiles/request/Request;Lorg/apache/tiles/autotag/core/runtime/ModelBody;)V > (loaded from > file:/C:/Program%20Files/ibm/WebSphere/AppServer_1/profiles/AppSrv01/installedApps/weds/BBSear.ear/BBS.ear/BBSWeb.war/WEB-INF/lib/struts2-tiles-plugin-6.3.0.2.jar > by > com.ibm.ws.classloader.CompoundClassLoader@d53dbbf4[war:BBS/BBSWeb.war] > > Can you please assist us. > > Thanks. > > > Noel Deleon > CRIS/ICRIS, 201-828-8524 > > > > > > > > > -Original Message- > From: Lukasz Lenart > Sent: Friday, January 12, 2024 12:40 AM > To: Struts Users Mailing List > Subject: [EXTERNAL] Re: Trouble with tag after upgrading from > struts v2.5.31 to v6.3.0.2 > > CAUTION! This email originated outside of the organization. Please do not > open attachments or click links from an unknown or suspicious origin. > > == > czw., 11 sty 2024 o 22:49 Burton Rhodes napisał(a): > > > > If I were to guess they removed the "?no_esc" flag in version 6.x in > > the .ftl file. That said, it's easy to override this. (Assuming you > > are using the Struts "simple" template) Locate the file > > [struts2-core-6.3.0.2.jar]\template\simple\radiomap.ftl and copy it > > into your resources directory with the same tree: > > resource\\template\simple\radiomap.ftl > > > > Then towards the end of the ftl file you will see the tag. > > Just add "?no_esc" to the ${itemValue}. Like this... > > > > > "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl"/>><#rt/> > > ${itemValue?no_esc}<#t/> > > > > > > They most likely removed it due to security issues, but feel free to > > change if you feel it's "safe". I tested the above code and it worked > > for me. > > Thanks Burton for the solution! The issue is rather simple, a new Freemarker > version escapes everything automatically, so we had to unescape everything. > Yet in this case there was never ?no_esc flag as this worked fine with older > versions of Freemarker. Adding ?no_esc shouldn't be a security issue IMHO. > Feel free to create a ticket in JIRA to address this problem. > > Cheers > Łukasz > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: [EXTERNAL] Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi, Need help. We use struts 2.5.25 with Tiles 3. We migrated struts 2.5.25 to struts 6.3.0.2, we hit error, see below, log from websphere app server version 9.0.5. [1/11/24 12:02:32:792 EST] 00f4 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause /cris/template/template.jsp: com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoSuchMethodError: org/apache/tiles/template/InsertAttributeModel.execute(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/apache/tiles/Attribute;ZLorg/apache/tiles/request/Request;Lorg/apache/tiles/autotag/core/runtime/ModelBody;)V (loaded from file:/C:/Program%20Files/ibm/WebSphere/AppServer_1/profiles/AppSrv01/installedApps/weds/BBSear.ear/BBS.ear/BBSWeb.war/WEB-INF/lib/struts2-tiles-plugin-6.3.0.2.jar by com.ibm.ws.classloader.CompoundClassLoader@d53dbbf4[war:BBS/BBSWeb.war] Can you please assist us. Thanks. Noel Deleon CRIS/ICRIS, 201-828-8524 -Original Message- From: Lukasz Lenart Sent: Friday, January 12, 2024 12:40 AM To: Struts Users Mailing List Subject: [EXTERNAL] Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2 CAUTION! This email originated outside of the organization. Please do not open attachments or click links from an unknown or suspicious origin. == czw., 11 sty 2024 o 22:49 Burton Rhodes napisał(a): > > If I were to guess they removed the "?no_esc" flag in version 6.x in > the .ftl file. That said, it's easy to override this. (Assuming you > are using the Struts "simple" template) Locate the file > [struts2-core-6.3.0.2.jar]\template\simple\radiomap.ftl and copy it > into your resources directory with the same tree: > resource\\template\simple\radiomap.ftl > > Then towards the end of the ftl file you will see the tag. > Just add "?no_esc" to the ${itemValue}. Like this... > > "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl"/>><#rt/> > ${itemValue?no_esc}<#t/> > > > They most likely removed it due to security issues, but feel free to > change if you feel it's "safe". I tested the above code and it worked > for me. Thanks Burton for the solution! The issue is rather simple, a new Freemarker version escapes everything automatically, so we had to unescape everything. Yet in this case there was never ?no_esc flag as this worked fine with older versions of Freemarker. Adding ?no_esc shouldn't be a security issue IMHO. Feel free to create a ticket in JIRA to address this problem. Cheers Łukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
czw., 11 sty 2024 o 22:49 Burton Rhodes napisał(a): > > If I were to guess they removed the "?no_esc" flag in version 6.x in the > .ftl file. That said, it's easy to override this. (Assuming you are > using the Struts "simple" template) Locate the file > [struts2-core-6.3.0.2.jar]\template\simple\radiomap.ftl and copy it > into your resources directory with the same tree: > resource\\template\simple\radiomap.ftl > > Then towards the end of the ftl file you will see the tag. Just > add "?no_esc" to the ${itemValue}. Like this... > > "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl"/>><#rt/> > ${itemValue?no_esc}<#t/> > > > They most likely removed it due to security issues, but feel free to > change if you feel it's "safe". I tested the above code and it worked > for me. Thanks Burton for the solution! The issue is rather simple, a new Freemarker version escapes everything automatically, so we had to unescape everything. Yet in this case there was never ?no_esc flag as this worked fine with older versions of Freemarker. Adding ?no_esc shouldn't be a security issue IMHO. Feel free to create a ticket in JIRA to address this problem. Cheers Łukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
If I were to guess they removed the "?no_esc" flag in version 6.x in the .ftl file. That said, it's easy to override this. (Assuming you are using the Struts "simple" template) Locate the file [struts2-core-6.3.0.2.jar]\template\simple\radiomap.ftl and copy it into your resources directory with the same tree: resource\\template\simple\radiomap.ftl Then towards the end of the ftl file you will see the tag. Just add "?no_esc" to the ${itemValue}. Like this... "/${parameters.templateDir}/${parameters.expandTheme}/css.ftl"/>><#rt/> ${itemValue?no_esc}<#t/> They most likely removed it due to security issues, but feel free to change if you feel it's "safe". I tested the above code and it worked for me. Thanks, Burton -- Original Message -- From "Pranish Srigiri" To "Struts Users Mailing List" Date 1/11/2024 7:27:44 AM Subject Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2 Hi Lukasz, I tried testing with the latest Snapshot generated on the 9th of Jan. Good news is, the issue is resolved in this version. Thank you for all the help. I have an other question related to the same tag. We've used the tag like this in one of our pages. The above tag was rendered like this in v2.x Guest User Can share with existing defined Full or Power users image.png After I upgraded the struts version to v6.x, the tag renders like this. Guest User<i> Can share with existing defined Full or Power users</i> image.png If you notice the , in 2.x the html code in the list gets rendered as is inside the label, but in 6.x all the html characters are escaped. I haven't found a solution to this. There are a lot of places where code like this is used. I'm not sure how to proceed. Thanks and Regards, Pranish Srigiri On Wed, Jan 10, 2024 at 12:43 PM Pranish Srigiri wrote: Thanks for all the information Lukasz. Regards, Pranish Srigiri Sent from Gmail Mobile On Wed, 10 Jan 2024 at 1:29 AM, Lukasz Lenart wrote: wt., 9 sty 2024 o 20:01 Pranish Srigiri napisał(a): > Hi Lukasz, > I'm not sure if the PR is included in the present Snapshot available here. > https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ > I tried to test with this version of the Snapshot but unfortunately the > issue wasn't resolved, so I guess the PR isn't included in this version of > the SNAPSHOT. As I said, the PR got merged into codebase but the SNAPSHOT wasn't deployed because of [1] [1] https://issues.apache.org/jira/browse/INFRA-25350 Cheers Lukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi Lukasz, I tried testing with the latest Snapshot generated on the 9th of Jan. Good news is, the issue is resolved in this version. Thank you for all the help. I have an other question related to the same tag. We've used the tag like this in one of our pages. The above tag was rendered like this in v2.x Guest User Can share with existing defined Full or Power users [image: image.png] After I upgraded the struts version to v6.x, the tag renders like this. Guest User Can share with existing defined Full or Power users [image: image.png] If you notice the , in 2.x the html code in the list gets rendered as is inside the label, but in 6.x all the html characters are escaped. I haven't found a solution to this. There are a lot of places where code like this is used. I'm not sure how to proceed. Thanks and Regards, Pranish Srigiri On Wed, Jan 10, 2024 at 12:43 PM Pranish Srigiri wrote: > Thanks for all the information Lukasz. > > Regards, > Pranish Srigiri > > Sent from Gmail Mobile > > > On Wed, 10 Jan 2024 at 1:29 AM, Lukasz Lenart > wrote: > >> wt., 9 sty 2024 o 20:01 Pranish Srigiri >> napisał(a): >> > Hi Lukasz, >> > I'm not sure if the PR is included in the present Snapshot available >> here. >> > >> https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ >> > I tried to test with this version of the Snapshot but unfortunately the >> > issue wasn't resolved, so I guess the PR isn't included in this version >> of >> > the SNAPSHOT. >> >> As I said, the PR got merged into codebase but the SNAPSHOT wasn't >> deployed because of [1] >> [1] https://issues.apache.org/jira/browse/INFRA-25350 >> >> >> Cheers >> Lukasz >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >>
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Thanks for all the information Lukasz. Regards, Pranish Srigiri Sent from Gmail Mobile On Wed, 10 Jan 2024 at 1:29 AM, Lukasz Lenart wrote: > wt., 9 sty 2024 o 20:01 Pranish Srigiri napisał(a): > > Hi Lukasz, > > I'm not sure if the PR is included in the present Snapshot available > here. > > > https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ > > I tried to test with this version of the Snapshot but unfortunately the > > issue wasn't resolved, so I guess the PR isn't included in this version > of > > the SNAPSHOT. > > As I said, the PR got merged into codebase but the SNAPSHOT wasn't > deployed because of [1] > [1] https://issues.apache.org/jira/browse/INFRA-25350 > > > Cheers > Lukasz > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
wt., 9 sty 2024 o 20:04 Pranish Srigiri napisał(a): > I also noticed that 6.4 requires a new dependency called caffein. My server > wasn't starting until I included this dependency, > https://central.sonatype.com/artifact/com.github.ben-manes.caffeine/caffeine Yes, this is something to be addressed as well [1] [1] https://issues.apache.org/jira/browse/WW-5369 Cheers Łukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
wt., 9 sty 2024 o 20:01 Pranish Srigiri napisał(a): > Hi Lukasz, > I'm not sure if the PR is included in the present Snapshot available here. > https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ > I tried to test with this version of the Snapshot but unfortunately the > issue wasn't resolved, so I guess the PR isn't included in this version of > the SNAPSHOT. As I said, the PR got merged into codebase but the SNAPSHOT wasn't deployed because of [1] [1] https://issues.apache.org/jira/browse/INFRA-25350 Cheers Lukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
I also noticed that 6.4 requires a new dependency called caffein. My server wasn't starting until I included this dependency, https://central.sonatype.com/artifact/com.github.ben-manes.caffeine/caffeine Thanks and Regards, Pranish Srigiri On Wed, Jan 10, 2024 at 12:31 AM Pranish Srigiri wrote: > Hi Lukasz, > I'm not sure if the PR is included in the present Snapshot available here. > https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ > I tried to test with this version of the Snapshot but unfortunately the > issue wasn't resolved, so I guess the PR isn't included in this version of > the SNAPSHOT. > > Thanks and Regards, > Pranish Srigiri > > On Tue, Jan 9, 2024 at 11:36 PM Lukasz Lenart > wrote: > >> pon., 8 sty 2024 o 20:21 Pranish Srigiri >> napisał(a): >> > Hi Lukasz, >> > I think the PR could address the problem. I see that the fix-version of >> > WW-5365 is 6.4. When do you think v6.4 is going to go 'GA'? Is there a >> way >> > to test this PR? >> >> Version 6.4.0 will be released once this issue is resolved [1] - I >> think this is the final piece. >> >> The PR got merged and a SNAPSHOT version should be deployed to ASF >> Nexus soon [2] or you can download it from here [3] (once this ticket >> is addressed [4]) >> >> [1] https://issues.apache.org/jira/browse/WW-5352 >> [2] https://struts.apache.org/builds.html#maven-snapshots >> [3] https://nightlies.apache.org/struts/snapshot/ >> [4] https://issues.apache.org/jira/browse/INFRA-25350 >> >> >> Cheers >> Łukasz >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >>
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi Lukasz, I'm not sure if the PR is included in the present Snapshot available here. https://repository.apache.org/content/groups/snapshots/org/apache/struts/struts2-core/6.4.0-SNAPSHOT/ I tried to test with this version of the Snapshot but unfortunately the issue wasn't resolved, so I guess the PR isn't included in this version of the SNAPSHOT. Thanks and Regards, Pranish Srigiri On Tue, Jan 9, 2024 at 11:36 PM Lukasz Lenart wrote: > pon., 8 sty 2024 o 20:21 Pranish Srigiri > napisał(a): > > Hi Lukasz, > > I think the PR could address the problem. I see that the fix-version of > > WW-5365 is 6.4. When do you think v6.4 is going to go 'GA'? Is there a > way > > to test this PR? > > Version 6.4.0 will be released once this issue is resolved [1] - I > think this is the final piece. > > The PR got merged and a SNAPSHOT version should be deployed to ASF > Nexus soon [2] or you can download it from here [3] (once this ticket > is addressed [4]) > > [1] https://issues.apache.org/jira/browse/WW-5352 > [2] https://struts.apache.org/builds.html#maven-snapshots > [3] https://nightlies.apache.org/struts/snapshot/ > [4] https://issues.apache.org/jira/browse/INFRA-25350 > > > Cheers > Łukasz > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
pon., 8 sty 2024 o 20:21 Pranish Srigiri napisał(a): > Hi Lukasz, > I think the PR could address the problem. I see that the fix-version of > WW-5365 is 6.4. When do you think v6.4 is going to go 'GA'? Is there a way > to test this PR? Version 6.4.0 will be released once this issue is resolved [1] - I think this is the final piece. The PR got merged and a SNAPSHOT version should be deployed to ASF Nexus soon [2] or you can download it from here [3] (once this ticket is addressed [4]) [1] https://issues.apache.org/jira/browse/WW-5352 [2] https://struts.apache.org/builds.html#maven-snapshots [3] https://nightlies.apache.org/struts/snapshot/ [4] https://issues.apache.org/jira/browse/INFRA-25350 Cheers Łukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi Burton, The values are not based off an enum. The radio is linked to a String in the Action. I came across a question posted by Nate Kerkhofs on the 23rd of Nov, 2023. This helped me in resolving the issue by removing the 'value' attribute from the tag. We've used the tag more than 300 times in our project. It's going to be a task to check every single and remove the 'value' attribute. Hi Lukasz, I think the PR could address the problem. I see that the fix-version of WW-5365 is 6.4. When do you think v6.4 is going to go 'GA'? Is there a way to test this PR? My apologies to you guys for the late reply. Thanks and Regards, Pranish Srigiri On Sun, Jan 7, 2024 at 4:12 PM Lukasz Lenart wrote: > Could this PR [1] address your problem? > > [1] https://github.com/apache/struts/pull/835 > > > Regards > Łukasz > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Could this PR [1] address your problem? [1] https://github.com/apache/struts/pull/835 Regards Łukasz - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Curious... are the values based off an enum (as opposed to a String)? This was an issue for me at one point. -- Original Message -- From "Pranish Srigiri" To user@struts.apache.org Date 1/5/2024 2:46:36 PM Subject Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2 Hi All, I have a situation in my project where the radio buttons are not selected by default. This has only started happening after I upgraded struts to v6.3.0.2 Just a heads up, I've upgraded all the dependencies like OGNL, Freemarker, after I upgraded struts to v6.3.0.2 I have a tag which looks like this. I set the list 'YesNo' in my Action class that looks like this. ActionContext.getContext().put("YesNo", PageData.getInstance().getRadioYesNo(params)); Here PageData.getInstance().getRadioYesNo(params) returns a HashMap. In my action class sshCompress is set to "N": sshCompress = "N"; The above variable also has its getter and setter. When the page loads, the above struts radio tag is rendered like this in v2.5.31: Yes No but it's rendered like this in v6.3.0.2 Yes No If you notice, the radio button with value="N" is not checked by default in v6.3.0.2 even though sshCompress is being set to "N" in the Action. I can see this behaviour with all the tags where the list attribute is used, I'm not sure what has changed in the new version or if I have missed adding something. Like I said, no code has been changed in the project. The dependencies were upgraded and the necessary compiler issues were resolved. Please let me know if you need any more information. Really appreciate all your help. Thanks and Regards, Pranish Srigiri - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Trouble with tag after upgrading from struts v2.5.31 to v6.3.0.2
Hi All, I have a situation in my project where the radio buttons are not selected by default. This has only started happening after I upgraded struts to v6.3.0.2 Just a heads up, I've upgraded all the dependencies like OGNL, Freemarker, after I upgraded struts to v6.3.0.2 I have a tag which looks like this. I set the list 'YesNo' in my Action class that looks like this. ActionContext.getContext().put("YesNo", PageData.getInstance().getRadioYesNo(params)); Here PageData.getInstance().getRadioYesNo(params) returns a HashMap. In my action class sshCompress is set to "N": sshCompress = "N"; The above variable also has its getter and setter. When the page loads, the above struts radio tag is rendered like this in v2.5.31: Yes No but it's rendered like this in v6.3.0.2 Yes No If you notice, the radio button with value="N" is not checked by default in v6.3.0.2 even though sshCompress is being set to "N" in the Action. I can see this behaviour with all the tags where the list attribute is used, I'm not sure what has changed in the new version or if I have missed adding something. Like I said, no code has been changed in the project. The dependencies were upgraded and the necessary compiler issues were resolved. Please let me know if you need any more information. Really appreciate all your help. Thanks and Regards, Pranish Srigiri