struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: validating conditional fields...
Date Wed, 23 Jan 2008 16:20:07 GMT
Kavita Mehta wrote:
> Hi,
> i have a JSP in which either I show <x> , <y> fieds  or <y>, <z>
> based on some condition . 
> Now, i have to validate all x, y,z fields in such a way that if these 
> fields are present, they should be validated else not .
> can somebdy pls suggest how to do this ...

Echoing what Ravi said, you can code this trivially in Java in your 
action's validation. If you prefer using declarative validation (XML or 
Struts2 annotations) you will need to use 'conditional validation'. The 
details of how to do that depend on what version of Struts you're using, 
and what validation strategy you use.

Please post more details of your environment and setup if you need 
further help.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message