struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Peraferrer <corellia...@gmail.com>
Subject [s2] Custom field validator with params containing OGNL expression
Date Tue, 07 Jul 2009 08:24:36 GMT
Hi!

I have implemented a field validator that validates the username is
not already in the database (to avoid overwriting).
But in the validator call (or configuration), I need to pass a
parameter that is another field in the form. Here my code:

<field-validator type="usernameavailable">
      <param name="userId">${enterprise.enterpriseId}</param>
      <message>This username is already taken.</message>
    </field-validator>

The 'userId' is a Long value. I have tested putting a hardcoded long
value (<param name="userId">34</param>) and it worked, but
it doesn't like the OGNL expression. What I'm doing wrong?

Thanks in advance,
Cristian.

-- 
GPG Key-ID: 0x564903FA - JID: corellian@swissjabber.ch

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


Mime
View raw message