You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org> on 2009/11/25 20:12:39 UTC

[jira] Commented: (TRINIDAD-1634) tr:convertDateTime error handling can be improved to distinguish invalid date from invalid date format

    [ https://issues.apache.org/jira/browse/TRINIDAD-1634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782560#action_12782560 ] 

Yee-Wah Lee commented on TRINIDAD-1634:
---------------------------------------

Patch does not address the case where client-validation is disabled in trinidad-config.xml. In DateTimeConverter#_parse(), both string inputs '11/35/09' and '11/aa/09' throw a ParseException with parseMessage="Unparseable date: %0".
    DateFormat fmt = getDateFormat(context, pattern, true, null);
    try
    {
      return fmt.parse(value);

    } catch (ConverterException ce)
    {
      throw ce;
    }
    catch (ParseException pe)
    {
      Object[] params = _getPlaceHolderParameters(context, component, value);
      throw new ConverterException(getParseErrorMessage(context, component,
                                                        pattern, params),
           pe);
    }


> tr:convertDateTime error handling can be improved to distinguish invalid date from invalid date format
> ------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1634
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1634
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Components
>    Affects Versions:  1.2.12-core
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>         Attachments: trin12_1634.diff
>
>
> 1. Run the inputDate demo
> http://www.irian.at/trinidad-demo/faces/components/inputDate.jspx
> 2. On the top inputDate, type in a non-existing date, e.g. 2/29/2009  and click the Submit button. 
> 3. Error message returned is:
>  Enter a date in the same format as this example: 11/29/1998
> The date is actually in a valid format, so this is to see if the error handling can distinguish the invalid format case from the invalid date case. 

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