struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (WW-4240) TypeConversionErrors with Maps
Date Thu, 21 Aug 2014 19:19:11 GMT

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

Lukasz Lenart edited comment on WW-4240 at 8/21/14 7:17 PM:
------------------------------------------------------------

It must be something other, {{XWorkConverterTest}} contains the below test - as you can see,
internal converter skips non-convertible values

{code:java}
    public void testCollectionConversion() throws Exception {
        // given
        String[] col1 = new String[]{"1", "2", "ble", "3"};

        // when
        Object converted = converter.convertValue(context, new ListAction(), null, "ints",
col1, List.class);

        // then
        assertEquals(converted, Arrays.asList(1, 2, 3));
    }
{code}

Please prepare a demo app as I cannot reproduce this behaviour


was (Author: lukaszlenart):
It must something other, {{XWorkConverterTest}} contains the below test - as you can see,
internal converter skips non-convertible values

{code:java}
    public void testCollectionConversion() throws Exception {
        // given
        String[] col1 = new String[]{"1", "2", "ble", "3"};

        // when
        Object converted = converter.convertValue(context, new ListAction(), null, "ints",
col1, List.class);

        // then
        assertEquals(converted, Arrays.asList(1, 2, 3));
    }
{code}

Please prepare a demo app as I cannot reproduce this behaviour

> TypeConversionErrors with Maps
> ------------------------------
>
>                 Key: WW-4240
>                 URL: https://issues.apache.org/jira/browse/WW-4240
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.15.1, 2.3.16
>            Reporter: Andreas Sachs
>            Priority: Minor
>             Fix For: 2.3.18
>
>
> Hello,
> i have an action with the following map definition:
> private Map<Integer, Integer> baelle;
> The jsp contains textfields.
> If the user enters a String instead of an Integer, the map contains a String-Element
with the value "ognl.NoConversionPossible". The validation method is called.
> If i have an Integer property and the user enters a String, the validation method is
not called. Instead the input-page is shown again. I would expect the same behaviour with
a map.
> Thanks
> Andreas



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message