You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Niall Pemberton <ni...@gmail.com> on 2006/08/25 14:59:57 UTC

Re: 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 greenhor

There isn't any way to do this. Also if there was a way theres a
danger that by re-displaying what the user keys in you could be
opening your app up to an XSS vulnerability:

http://wiki.apache.org/struts/StrutsXssVulnerability

Niall

On 8/25/06, Robert Harrison <rh...@gmail.com> wrote:
>  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
>
>

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