You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/06/22 04:46:38 UTC

DO NOT REPLY [Bug 35459] New: - validateDate cannot handle exception

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35459>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35459

           Summary: validateDate cannot handle exception
           Product: Struts
           Version: 1.2.7
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Validator Framework
        AssignedTo: dev@struts.apache.org
        ReportedBy: tonny_1983@hotmail.com


I make the defination in validation.xml as follows:
<field property="Date" depends="date">        
   <arg0 key="date" resource="false" />
        <var>
	    <var-name>datePattern</var-name>
	    <var-value>yyyy/MM/dd</var-value>
        </var>
</field>
While the value of property equals "2005/06/1t", it shows that this value is
passed. I found in the source code of validateDate(...) that there's a function
named GenericTypeValidator.formatDate. So I maked a test:
----------------------------------------------------------------
  Date result = GenericTypeValidator.formatDate("2005/06/1t", "yyyy/MM/dd", false);
  System.out.println(result);
-----------------------------------------------------------------
then I got the result: Wed Jun 01 00:00:00 CST 2005
There're no exceptions and the result is also valued, so validateDate(...)
returns Boolean.TRUE. I think the problem is in
GenericTypeValidator.formatDate(...).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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