You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Burton Rhodes <bu...@gmail.com> on 2019/12/29 18:33:52 UTC

S2.5.22 custom StrutsTypeConverter values parameter has changed?

After upgrading to v2.5.22 my custom StrutsTypeConverters are having issues
when the passed html form parameter is empty (or null).

Specifically in my overridden convertFromString(context, values, toClass)
method, the values parameter now contains
values[0]="ognl.NoConversionPossible".  In v2.5.20, the values[0]="".

Do you know why values[] contains this error text rather than the actual
empty value like it used to?  Is there a setup issue on my end?

Thanks in advance,
Burton

Re: S2.5.22 custom StrutsTypeConverter values parameter has changed?

Posted by Lukasz Lenart <lu...@apache.org>.
niedz., 29 gru 2019 o 20:38 Burton Rhodes <bu...@gmail.com> napisał(a):
>
> It appears I needed to change my tag to the following (removing the null
> check from within the getText() method):
>
> <s:hidden name=" xaction.splitAssistant" id="xactionSplitAssistant"
> value="%{xaction.splitAssistant != null
> ? getText('format.percent',{xaction.splitAssistant * 100}) : ''}" />

I assume you have migrated from 2.5.20 to 2.5.22? Would you mind
creating a JIRA ticket? I would like to investigate this issue deeper.
It can be also a problem of nested expressions as you embedded an
expression inside "%{getText()}" expression.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2.5.22 custom StrutsTypeConverter values parameter has changed?

Posted by Burton Rhodes <bu...@gmail.com>.
It appears I needed to change my tag to the following (removing the null
check from within the getText() method):

<s:hidden name=" xaction.splitAssistant" id="xactionSplitAssistant"
value="%{xaction.splitAssistant != null
? getText('format.percent',{xaction.splitAssistant * 100}) : ''}" />

On Sun, Dec 29, 2019 at 1:02 PM Burton Rhodes <bu...@gmail.com>
wrote:

> So I think it may have to do with my actual jsp page.
>
> # Defined in package properties
> format.percent = {0,number,##0.00'%'}
>
> <!-- JSP -->
> <s:hidden name=" xaction.splitAssistant" id="xactionSplitAssistant"
> value="%{getText('format.percent',{xaction.splitAssistant != null ?
> xaction.splitAssistant * 100 :''})}" />
>
> the tag above prints:
> <input type="hidden" name="xaction.splitAssistant"
> value="ognl.NoConversionPossible" id="xactionSplitAssistant">
>
> I assume OGNL has changed it's getText code logic.  Any guess as to how I
> can change the tag above to play nicely with newer version of OGNL?
>
>
> On Sun, Dec 29, 2019 at 12:45 PM Burton Rhodes <bu...@gmail.com>
> wrote:
>
>> I don't override anything in my pom.xml files in regards to OGNL.
>> Looking at the dependency analyzer, the resolved OGNL version is v3.1.26.
>> And I am including struts with the following dependencies.
>>
>>         <dependency>
>>             <groupId>org.apache.struts</groupId>
>>             <artifactId>struts2-core</artifactId>
>>             <version>2.5.22</version>
>>         </dependency>
>>         <dependency>
>>             <groupId>org.apache.struts</groupId>
>>             <artifactId>struts2-spring-plugin</artifactId>
>>               <version>2.5.22</version>
>>         </dependency>
>>         <dependency>
>>             <groupId>org.apache.struts</groupId>
>>             <artifactId>struts2-json-plugin</artifactId>
>>               <version>2.5.22</version>
>>         </dependency>2.5.22
>>
>>
>>
>> On Sun, Dec 29, 2019 at 12:35 PM Lukasz Lenart <lu...@apache.org>
>> wrote:
>>
>>> niedz., 29 gru 2019 o 19:34 Burton Rhodes <bu...@gmail.com>
>>> napisał(a):
>>> >
>>> > After upgrading to v2.5.22 my custom StrutsTypeConverters are having
>>> issues
>>> > when the passed html form parameter is empty (or null).
>>> >
>>> > Specifically in my overridden convertFromString(context, values,
>>> toClass)
>>> > method, the values parameter now contains
>>> > values[0]="ognl.NoConversionPossible".  In v2.5.20, the values[0]="".
>>> >
>>> > Do you know why values[] contains this error text rather than the
>>> actual
>>> > empty value like it used to?  Is there a setup issue on my end?
>>>
>>> Do you use the same version of OGNL as provided with Struts?
>>>
>>>
>>> Regards
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>

Re: S2.5.22 custom StrutsTypeConverter values parameter has changed?

Posted by Burton Rhodes <bu...@gmail.com>.
So I think it may have to do with my actual jsp page.

# Defined in package properties
format.percent = {0,number,##0.00'%'}

<!-- JSP -->
<s:hidden name=" xaction.splitAssistant" id="xactionSplitAssistant"
value="%{getText('format.percent',{xaction.splitAssistant != null ?
xaction.splitAssistant * 100 :''})}" />

the tag above prints:
<input type="hidden" name="xaction.splitAssistant"
value="ognl.NoConversionPossible" id="xactionSplitAssistant">

I assume OGNL has changed it's getText code logic.  Any guess as to how I
can change the tag above to play nicely with newer version of OGNL?


On Sun, Dec 29, 2019 at 12:45 PM Burton Rhodes <bu...@gmail.com>
wrote:

> I don't override anything in my pom.xml files in regards to OGNL.  Looking
> at the dependency analyzer, the resolved OGNL version is v3.1.26.  And I am
> including struts with the following dependencies.
>
>         <dependency>
>             <groupId>org.apache.struts</groupId>
>             <artifactId>struts2-core</artifactId>
>             <version>2.5.22</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.struts</groupId>
>             <artifactId>struts2-spring-plugin</artifactId>
>               <version>2.5.22</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.struts</groupId>
>             <artifactId>struts2-json-plugin</artifactId>
>               <version>2.5.22</version>
>         </dependency>2.5.22
>
>
>
> On Sun, Dec 29, 2019 at 12:35 PM Lukasz Lenart <lu...@apache.org>
> wrote:
>
>> niedz., 29 gru 2019 o 19:34 Burton Rhodes <bu...@gmail.com>
>> napisał(a):
>> >
>> > After upgrading to v2.5.22 my custom StrutsTypeConverters are having
>> issues
>> > when the passed html form parameter is empty (or null).
>> >
>> > Specifically in my overridden convertFromString(context, values,
>> toClass)
>> > method, the values parameter now contains
>> > values[0]="ognl.NoConversionPossible".  In v2.5.20, the values[0]="".
>> >
>> > Do you know why values[] contains this error text rather than the actual
>> > empty value like it used to?  Is there a setup issue on my end?
>>
>> Do you use the same version of OGNL as provided with Struts?
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>

Re: S2.5.22 custom StrutsTypeConverter values parameter has changed?

Posted by Burton Rhodes <bu...@gmail.com>.
I don't override anything in my pom.xml files in regards to OGNL.  Looking
at the dependency analyzer, the resolved OGNL version is v3.1.26.  And I am
including struts with the following dependencies.

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.5.22</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-spring-plugin</artifactId>
              <version>2.5.22</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-json-plugin</artifactId>
              <version>2.5.22</version>
        </dependency>2.5.22



On Sun, Dec 29, 2019 at 12:35 PM Lukasz Lenart <lu...@apache.org>
wrote:

> niedz., 29 gru 2019 o 19:34 Burton Rhodes <bu...@gmail.com>
> napisał(a):
> >
> > After upgrading to v2.5.22 my custom StrutsTypeConverters are having
> issues
> > when the passed html form parameter is empty (or null).
> >
> > Specifically in my overridden convertFromString(context, values, toClass)
> > method, the values parameter now contains
> > values[0]="ognl.NoConversionPossible".  In v2.5.20, the values[0]="".
> >
> > Do you know why values[] contains this error text rather than the actual
> > empty value like it used to?  Is there a setup issue on my end?
>
> Do you use the same version of OGNL as provided with Struts?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: S2.5.22 custom StrutsTypeConverter values parameter has changed?

Posted by Lukasz Lenart <lu...@apache.org>.
niedz., 29 gru 2019 o 19:34 Burton Rhodes <bu...@gmail.com> napisał(a):
>
> After upgrading to v2.5.22 my custom StrutsTypeConverters are having issues
> when the passed html form parameter is empty (or null).
>
> Specifically in my overridden convertFromString(context, values, toClass)
> method, the values parameter now contains
> values[0]="ognl.NoConversionPossible".  In v2.5.20, the values[0]="".
>
> Do you know why values[] contains this error text rather than the actual
> empty value like it used to?  Is there a setup issue on my end?

Do you use the same version of OGNL as provided with Struts?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org