struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-2408) date-validator broken
Date Tue, 08 Jan 2008 16:16:05 GMT
date-validator broken
---------------------

                 Key: WW-2408
                 URL: https://issues.apache.org/struts/browse/WW-2408
             Project: Struts 2
          Issue Type: Bug
          Components: XML Validators
    Affects Versions: 2.0.11
         Environment: wintel 
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
TC 5.5.17
struts-2.0.11

            Reporter: Martin Gainty
            Priority: Minor


	<package name="validation" extends="struts-default" namespace="/validation">
	    <action name="quizBasic" class="org.apache.struts2.showcase.validation.QuizAction">
            <result name="input">quiz-basic.jsp</result>
            <result>quiz-success.jsp</result>
        </action>

where quizBasic.jsp contains the following form
<s:form method="post">
    <s:textfield label="Name" name="name"/>
    <s:textfield label="Age" name="age"/>
    <s:textfield label="Favorite color" name="answer"/>
    <s:textfield label="date" name="date"/>
    <s:submit/>
</s:form>

following instructions for configuration of date-validator from tim jee at
http://struts.apache.org/2.x/docs/date-validator.html

QuizAction-validation.xml contains the following 
<validators>
    <field name="name">
        <field-validator type="requiredstring">
            <message>You must enter a name</message>
        </field-validator>
    </field>
    <field name="age">
        <field-validator type="int">
            <param name="min">13</param>
            <param name="max">19</param>
            <message>Only people ages 13 to 19 may take this quiz</message>
        </field-validator>
    </field>
    <field name="date">
	 <field-validator type="date">
		 <param name="min">01/01/1900</param>
		 <param name="max">01/01/2099</param>
		 <message>invalid date</message>
	</field-validator>
   </field>    
</validators>

will pass any date thru 



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


Mime
View raw message