[jira] [Commented] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596997#comment-17596997
 ] 

ASF subversion and git services commented on WW-5212:
-

Commit b5e802174aaf9b441ed374c2afcc85285f9d0943 in struts's branch 
refs/heads/master from Lukasz Lenart
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=b5e802174 ]

WW-5212 Upgrades to Spring 5.3.22


> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Commented] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596998#comment-17596998
 ] 

ASF subversion and git services commented on WW-5212:
-

Commit 58a76162a658611e492f1ff9f3ab145c8433b7f1 in struts's branch 
refs/heads/master from Lukasz Lenart
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=58a76162a ]

Merge pull request #592 from apache/upgrade-spring

[WW-5212] Upgrades to Spring 5.3.22

> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Resolved] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread Lukasz Lenart (Jira)


 [ 
https://issues.apache.org/jira/browse/WW-5212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-5212.
---
Resolution: Fixed

> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Work logged] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 29/Aug/22 06:29
Start Date: 29/Aug/22 06:29
Worklog Time Spent: 10m 
  Work Description: lukaszlenart merged PR #592:
URL: https://github.com/apache/struts/pull/592




Issue Time Tracking
---

Worklog Id: (was: 804261)
Time Spent: 20m  (was: 10m)

> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Commented] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596986#comment-17596986
 ] 

ASF subversion and git services commented on WW-5212:
-

Commit b5e802174aaf9b441ed374c2afcc85285f9d0943 in struts's branch 
refs/heads/upgrade-spring from Lukasz Lenart
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=b5e802174 ]

WW-5212 Upgrades to Spring 5.3.22


> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Work logged] (WW-5212) Upgrade Spring to version 5.3.22

2022-08-28 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 29/Aug/22 06:03
Start Date: 29/Aug/22 06:03
Worklog Time Spent: 10m 
  Work Description: lukaszlenart opened a new pull request, #592:
URL: https://github.com/apache/struts/pull/592

   Fixes [WW-5212](https://issues.apache.org/jira/browse/WW-5212)




Issue Time Tracking
---

Worklog Id: (was: 804258)
Remaining Estimate: 0h
Time Spent: 10m

> Upgrade Spring to version 5.3.22
> 
>
> Key: WW-5212
> URL: https://issues.apache.org/jira/browse/WW-5212
> Project: Struts 2
>  Issue Type: Dependency
>Reporter: Lukasz Lenart
>Priority: Major
> Fix For: 6.1.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> https://github.com/spring-projects/spring-framework/releases/tag/v5.3.22



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


[jira] [Commented] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Lukasz Lenart (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596983#comment-17596983
 ] 

Lukasz Lenart commented on WW-5217:
---

The simplest approach is to use on of factory methods 
{{Ognl.createDefaultContext(...)}}

> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Closed] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Lukasz Lenart (Jira)


 [ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart closed WW-5217.
-
Resolution: Not A Problem

> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Commented] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Alireza Fattahi (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596977#comment-17596977
 ] 

Alireza Fattahi commented on WW-5217:
-

According to issue which you mentioned the 
[https://github.com/orphan-oss/ognl/pull/101/files] shows that the empty 
constructor was removed. 

Well, is there any work around for this so our code could still work ?!

> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Commented] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Alireza Fattahi (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596968#comment-17596968
 ] 

Alireza Fattahi commented on WW-5217:
-

Thanks!

In the the project the struts `2.5.30` was used and the `ognl-3.1.29.jar` was 
imported ( I have not add OGNL in pom  and I think it was added as an struts 
dependency) .

In version 3.1.29 the OgnlContext() has an empty constructor. I decompile and 
it is as below

 
{code:java}

public OgnlContext() {
   this(null, null, null);
}{code}
 

> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Commented] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Yasser Zamani (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17594330#comment-17594330
 ] 

Yasser Zamani commented on WW-5217:
---

thanks for reaching out!

Looks like you're affected by [https://github.com/orphan-oss/ognl/issues/81.] 
But could you please check from which jar and version your mentioned 
OgnlContext class comes from?! because I see that in ognl repository this class 
never have an empty constructor in the first place! I'm wondering how new 
OgnlContext() i.e. an empty constructor works for you. Have you downgraded ognl 
by droping jar file manually?

> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Updated] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Alireza Fattahi (Jira)


 [ 
https://issues.apache.org/jira/browse/WW-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alireza Fattahi updated WW-5217:

Description: 
We used the OGNL in our classes as below

 
{code:java}
OgnlExpression ognlExpression = new OgnlExpression(expressionString);
ognlExpression.getValue(new OgnlContext(), rootObject);{code}
 

The OgnlExpression is a simple wrapper.

 

 
{code:java}
public class OgnlExpression{
    private Object expression;
    private static final Logger LOG = 
LoggerFactory.getLogger(OgnlExpression.class);
    public OgnlExpression( String expressionString )
        throws OgnlException
    {
        super();
        expression = Ognl.parseExpression( expressionString );
    }
    public Object getExpression()
    {
        return expression;
    }
    public Object getValue( OgnlContext context, Object rootObject )
        throws OgnlException
    {
        LOG.debug("parse the expression with OGNL");
        return Ognl.getValue( getExpression(), context, rootObject );
    }
    public void setValue( OgnlContext context, Object rootObject, Object value )
        throws OgnlException
    {
        Ognl.setValue(getExpression(), context, rootObject, value);
    }
{code}
 

After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
removed. I test the `new OgnlContext(null,null,null)` but got illegal argument 
exception.

 

  was:
We used the OGNL in our classes as below

 
{code:java}
OgnlExpression ognlExpression = new OgnlExpression(expressionString);
ognlExpression.getValue(new OgnlContext(), rootObject);{code}
 

After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
removed. I test the `new OgnlContext(null,null,null)` but got illegal argument 
exception.

 


> new OgnlContext() is removed
> 
>
> Key: WW-5217
> URL: https://issues.apache.org/jira/browse/WW-5217
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Reporter: Alireza Fattahi
>Priority: Major
>
> We used the OGNL in our classes as below
>  
> {code:java}
> OgnlExpression ognlExpression = new OgnlExpression(expressionString);
> ognlExpression.getValue(new OgnlContext(), rootObject);{code}
>  
> The OgnlExpression is a simple wrapper.
>  
>  
> {code:java}
> public class OgnlExpression{
>     private Object expression;
>     private static final Logger LOG = 
> LoggerFactory.getLogger(OgnlExpression.class);
>     public OgnlExpression( String expressionString )
>         throws OgnlException
>     {
>         super();
>         expression = Ognl.parseExpression( expressionString );
>     }
>     public Object getExpression()
>     {
>         return expression;
>     }
>     public Object getValue( OgnlContext context, Object rootObject )
>         throws OgnlException
>     {
>         LOG.debug("parse the expression with OGNL");
>         return Ognl.getValue( getExpression(), context, rootObject );
>     }
>     public void setValue( OgnlContext context, Object rootObject, Object 
> value )
>         throws OgnlException
>     {
>         Ognl.setValue(getExpression(), context, rootObject, value);
>     }
> {code}
>  
> After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
> removed. I test the `new OgnlContext(null,null,null)` but got illegal 
> argument exception.
>  



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


[jira] [Created] (WW-5217) new OgnlContext() is removed

2022-08-28 Thread Alireza Fattahi (Jira)
Alireza Fattahi created WW-5217:
---

 Summary: new OgnlContext() is removed
 Key: WW-5217
 URL: https://issues.apache.org/jira/browse/WW-5217
 Project: Struts 2
  Issue Type: Bug
  Components: Expression Language
Reporter: Alireza Fattahi


We used the OGNL in our classes as below

 
{code:java}
OgnlExpression ognlExpression = new OgnlExpression(expressionString);
ognlExpression.getValue(new OgnlContext(), rootObject);{code}
 

After upgrade to version 6, the `new OgnlContext()` constructor seems to be 
removed. I test the `new OgnlContext(null,null,null)` but got illegal argument 
exception.

 



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


[jira] [Commented] (WW-5216) Freemarker Checkbox error after migrating from Struts 2.5.29 to 2.5.30

2022-08-28 Thread Yasser Zamani (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17586161#comment-17586161
 ] 

Yasser Zamani commented on WW-5216:
---

BTW I'm wondering how Struts 2.5.29 evaluates 
'_sharedmb_a-b@sc.d_member_j@e.com' expression to a boolean?! Do you know? 
just am curious!

Anyway, in Struts 2.5.30, because it's a re-evaluation, it checks it against 
accepted patterns. And here it doesn't match accepted patterns so Struts 
doesn't evaluate it due to security reasons.

> Freemarker Checkbox error after migrating from Struts 2.5.29 to 2.5.30
> --
>
> Key: WW-5216
> URL: https://issues.apache.org/jira/browse/WW-5216
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.5.30
>Reporter: Abdel-B ELMILI
>Priority: Major
>
> Hello,
> We had the following error after migrating from struts 2.5.16 to struts 
> 2.5.30 :
> {{2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] WARN :: 
> Expression [_sharedmb_a-b@sc.d_member_j@e.com] isn't allowed by pattern 
> [[\w+((\.\w+)|(\[\d+])|(\(\d+\))|(\['(\w|[\u4e00-\u9fa5])+'])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]!
>  See Accepted / Excluded patterns at
> https://struts.apache.org/security/
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] DEBUG:: 
> TemplateLoader.findTemplateSource("template/simple/checkbox.ftl"): Found
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] DEBUG:: 
> "template/simple/checkbox.ftl"("en_US", UTF-8, parsed): using cached since 
> jar:file://WEB-INF/lib/struts2-core-2.5.30.jar!/template/simple/checkbox.ftl
>  hasn't changed.
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] ERROR:: Error 
> executing FreeMarker template
> freemarker.core.NonBooleanException: For "&&" right-hand operand: Expected a 
> boolean, but this has evaluated to a string+extended_hash (String wrapped 
> into f.e.b.StringModel):
> ==> parameters.nameValue  [in template "template/simple/checkbox.ftl" at line 
> 22, column 32]
> 
> FTL stack trace ("~" means nesting-related):
>   - Failed at: #if parameters.nameValue?? && paramet...  [in template 
> "template/simple/checkbox.ftl" at line 22, column 1]
> 
>   at freemarker.core.Expression.modelToBoolean(Expression.java:195) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Expression.evalToBoolean(Expression.java:178) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Expression.evalToBoolean(Expression.java:163) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.AndExpression.evalToBoolean(AndExpression.java:36) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.visit(Environment.java:347) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.visit(Environment.java:353) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.process(Environment.java:326) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.template.Template.process(Template.java:383) 
> [freemarker-2.3.31.jar:2.3.31]
>   at 
> org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:154)
>  [struts2-core-2.5.30.jar:2.5.30]}}
> We don't have the issue if we downgrade to struts 2.5.9
> The checkbox causing the error is the following :
>      
> id="%\{j_prefixe_shared_mailbox+#smbEmail+j_prefixe_member+#emailMember}"??
>     
> name="%\{j_prefixe_shared_mailbox+#smbEmail+j_prefixe_member+#emailMember}"??
>     fieldValue="%\{#emailMember}"??
>     value="false"/>??
> We saw the WW-5178 , but in our case the value attribute is defined.
> We set a breakpoint in the modelToBoolean() function where the exception is 
> thrown (Expression.java). It seems that the parameters.nameValue used in the 
> template (<#if parameters.nameValue?? && parameters.nameValue>) is a 
> modelString (and not a boolean) which is equal to :
> _sharedmb_a-b@sc.d_member_j@e.com  (this value is what we set in the name 
> / id attributes of the checkbox)
>  
>  



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


[jira] [Commented] (WW-5216) Freemarker Checkbox error after migrating from Struts 2.5.29 to 2.5.30

2022-08-28 Thread Yasser Zamani (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17586160#comment-17586160
 ] 

Yasser Zamani commented on WW-5216:
---

Thanks for reaching out!

 

Are you sure that those logs belong to that specific checkbox you mentioned 
i.e. that with value="false"?! I don't think so, because the first WARN log 
above in description shows that it's going to re-evaluate 'name', and it 
re-evaluates 'name' if and only if 'value' isn't set, provided you've set it to 
"false"! These mean that probably those logs belong to another checkbox with a 
not set value. wdyt?

> Freemarker Checkbox error after migrating from Struts 2.5.29 to 2.5.30
> --
>
> Key: WW-5216
> URL: https://issues.apache.org/jira/browse/WW-5216
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.5.30
>Reporter: Abdel-B ELMILI
>Priority: Major
>
> Hello,
> We had the following error after migrating from struts 2.5.16 to struts 
> 2.5.30 :
> {{2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] WARN :: 
> Expression [_sharedmb_a-b@sc.d_member_j@e.com] isn't allowed by pattern 
> [[\w+((\.\w+)|(\[\d+])|(\(\d+\))|(\['(\w|[\u4e00-\u9fa5])+'])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]!
>  See Accepted / Excluded patterns at
> https://struts.apache.org/security/
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] DEBUG:: 
> TemplateLoader.findTemplateSource("template/simple/checkbox.ftl"): Found
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] DEBUG:: 
> "template/simple/checkbox.ftl"("en_US", UTF-8, parsed): using cached since 
> jar:file://WEB-INF/lib/struts2-core-2.5.30.jar!/template/simple/checkbox.ftl
>  hasn't changed.
> 2022-08-24 17:31:40 [https-jsse-nio-127.0.0.1-7443-exec-23] ERROR:: Error 
> executing FreeMarker template
> freemarker.core.NonBooleanException: For "&&" right-hand operand: Expected a 
> boolean, but this has evaluated to a string+extended_hash (String wrapped 
> into f.e.b.StringModel):
> ==> parameters.nameValue  [in template "template/simple/checkbox.ftl" at line 
> 22, column 32]
> 
> FTL stack trace ("~" means nesting-related):
>   - Failed at: #if parameters.nameValue?? && paramet...  [in template 
> "template/simple/checkbox.ftl" at line 22, column 1]
> 
>   at freemarker.core.Expression.modelToBoolean(Expression.java:195) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Expression.evalToBoolean(Expression.java:178) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Expression.evalToBoolean(Expression.java:163) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.AndExpression.evalToBoolean(AndExpression.java:36) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48) 
> ~[freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.visit(Environment.java:347) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.visit(Environment.java:353) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.core.Environment.process(Environment.java:326) 
> [freemarker-2.3.31.jar:2.3.31]
>   at freemarker.template.Template.process(Template.java:383) 
> [freemarker-2.3.31.jar:2.3.31]
>   at 
> org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:154)
>  [struts2-core-2.5.30.jar:2.5.30]}}
> We don't have the issue if we downgrade to struts 2.5.9
> The checkbox causing the error is the following :
>      
> id="%\{j_prefixe_shared_mailbox+#smbEmail+j_prefixe_member+#emailMember}"??
>     
> name="%\{j_prefixe_shared_mailbox+#smbEmail+j_prefixe_member+#emailMember}"??
>     fieldValue="%\{#emailMember}"??
>     value="false"/>??
> We saw the WW-5178 , but in our case the value attribute is defined.
> We set a breakpoint in the modelToBoolean() function where the exception is 
> thrown (Expression.java). It seems that the parameters.nameValue used in the 
> template (<#if parameters.nameValue?? && parameters.nameValue>) is a 
> modelString (and not a boolean) which is equal to :
> _sharedmb_a-b@sc.d_member_j@e.com  (this value is what we set in the name 
> / id attributes of the checkbox)
>  
>  



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