You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Amaury (JIRA)" <ji...@apache.org> on 2017/10/13 07:30:00 UTC
[jira] [Comment Edited] (WW-4870) StringConverter from OGNL 3.1.15
in Struts 2.5.13
[ https://issues.apache.org/jira/browse/WW-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16203155#comment-16203155 ]
Amaury edited comment on WW-4870 at 10/13/17 7:29 AM:
------------------------------------------------------
Sure:
*FTL side*
<#list passagers.entrySet() as entry>
<div class="pax">
# Here we have entry.key in the 'x.y' format
<@s.if test="{color:red}%{isPassengerSelectable(${entry.key}){color}}">
<input type="checkbox" id="${id + entry_index}" name="${id}" value="${entry.key}" />
</...@s.if>
<@s.else>
<input type="checkbox" id="${id + entry_index}" name="${id}" value="${entry.key}" disabled="true" />
</...@s.else>
...
*Java side:*
public boolean isPassengerSelectable(String idPassenger) {
/* Here we receive idPassenger as "x,y" instead of "x.y" in the webservice original response. We see a shift with decimal conversion in StringConverter class with fr_Fr locale */
was (Author: afages):
Sure:
*FTL side*
<#list passagers.entrySet() as entry>
<div class="pax">
# Here we have entry.key in the 'x.y' format
<@s.if test="{color:red}%{isPassengerSelectable(${entry.key}){color}}">
<input type="checkbox" id="${id + entry_index}" name="${id}" value="${entry.key}" />
</...@s.if>
<@s.else>
<input type="checkbox" id="${id + entry_index}" name="${id}" value="${entry.key}" disabled="true" />
</...@s.else>
...
*Java side:*
public boolean isPassengerSelectable(String idPassenger) {
/* Here we receive idPassenger as "x,y" instead of "x.y" in the webservice original response. We see a shift with decimal conversion in StringConverter class with fr_Fr locale */
> StringConverter from OGNL 3.1.15 in Struts 2.5.13
> -------------------------------------------------
>
> Key: WW-4870
> URL: https://issues.apache.org/jira/browse/WW-4870
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.5.13
> Reporter: Amaury
> Fix For: 2.5.14
>
>
> Hi Apache / Struts 2 team,
> We've just discovered a bug with the new version 2.5.13 of Struts 2, mainly in OGNL dependency. This is not the case with 2.5.10.
> *Scenario*: we have a boolean method in a "if" condition statement in FTL view. This method takes on argument which is a String ID in the format "X.Y" (ex: "1.1).
> *Result obtained during the OGNL parsing*: StringConverter is called according to the "locale" of the browser and apparently with "fr_FR" locale, the "X.Y" is converted to decimal format "X,Y" which is wrong since we want to stick with our ID as it arrives.
> It seems with en_US locale, the decimal conversion doesn't happen.
> *Result expected*: the ID "X.Y" goes to the "if" statement as it is, not converted in fr_Fr locale.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)