You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2008/11/17 22:22:37 UTC

[jira] Commented: (WW-2307) The value of the parameter is changing when the validation occurs both with annotation and xml

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

Musachy Barroso commented on WW-2307:
-------------------------------------

The fix to this is not as easy as it sounds. The values shown in the page usually come from the action in the stack, not from the parameters. I think real problem is that these conversion problems are not reported as such, from this code in XWorkBasicConverter

NumberFormat numFormat = NumberFormat.getInstance(getLocale(context));
ParsePosition parsePos = new ParsePosition(0);
if (isIntegerType(toType)) {
     numFormat.setParseIntegerOnly(true);
}
numFormat.setGroupingUsed(true);
Number number = numFormat.parse(stringValue, parsePos);

NumberFormat  will return -1 when it cannot parse the string. The solution would be to fix this and report the conversion error, like the other conversion errors, that's as much as the framework can do I think.

> The value of the parameter is changing when the validation occurs both with annotation and xml
> ----------------------------------------------------------------------------------------------
>
>                 Key: WW-2307
>                 URL: https://issues.apache.org/struts/browse/WW-2307
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.0.11
>         Environment: WindowsXP SP2 and jboss 4.2.1
>            Reporter: Jason Douglas de Oliveira
>            Priority: Critical
>             Fix For: Future
>
>
> When I have an action's attribute of Integer type and use the @IntRangeFieldValidator the value is returned truncated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.