struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <Adam.Gor...@readytalk.com>
Subject Question on field/arg element in validator XML file
Date Thu, 13 Jul 2006 17:07:49 GMT
I'm reading the validator 1.1.3 DTD file and I'm trying to understand the
purpose of the "position" attribute in the <arg> element and the <arg>
element itself.  According to the DTD: 'The "arg" element defines a
replacement value to use with the message template for this validator or
this field.'

Can someone please dumb this down for me?

So, if I have:

<field property="meetingDate"
       depends="required, date, maxlength, mask">
  <arg position="0" key="prompt.date"/>
  <arg position="1"
       name="maxlength"
       key="${var:maxlength}"
       resource="false"/>
  <var>
    <var-name>datePattern</var-name>
    <var-value>MM/dd/yyyy</var-value>
  </var>
  <var>
    <var-name>maxlength</var-name>
    <!-- the value here MUST match the maxlength attribute in the JSP
         for the text field with this property name -->
    <var-value>12</var-value>
  </var>
  <var>
    <var-name>mask</var-name>
 
<var-value>^(((0?[1-9]|1[012])/(0?[1-9]|1\d|2[0-8])|(0?[13456789]|1[012])/(2
9|30)|(0?[13578]|1[02])/31)/(20)((0[6-9])|(10))|0?2/29/((20)(0[48])))$</var-
value>
  </var>
</field>

Does the position attribute refer to the "index" of the <var> element?  So
that it knows which "rule" to match?

Thanks,

-Adam


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message