You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Robert Harrison <rh...@gmail.com> on 2006/08/25 13:31:09 UTC

Pass value from validation.xml to error message? Bob Harrison greenhorn Member # 122590 Pass value from validation.xml to error message? Bob Harrison greenhorn Member # 122590 Pass value from validation.xml to error message? Bob Harrison greenhorn Me

 I can't find an example of how to insert an invalid credit card number into
the error message "errors.creditcard={0} is an invalid credit card number".

I'm using Struts 1.2.8

Here's my validation.xml snippet:
<field property="ccnum" depends="required, creditCard">
<var>
<var-name>cCard</var-name>
<var-value>${ccnum}</var-value>
</var>
<arg position="0" name="required" key="errors.creditCard.number" />
<arg key="${var:cCard}" name="creditCard" resource="false" position="0" />
</field>

With the above snippet, the error message produced is:
"${ccnum} is an invalid credit card number."

Can someone give me an example of how to pass the "ccnum" to arg0?

Thanks,
Bob

-- 
"In theory there is no difference between theory and practice. In practice
there is."
Yogi Berra