struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Harper" <bhar...@solutionst.com>
Subject Re: Advanced Struts 2 Validation Question...
Date Thu, 13 Nov 2008 15:43:18 GMT
Implement Valiadateable in your action and the Workflow interceptor will
call validate() before and action method  If your validate() method adds
ActionErrors then the messages go back to the input form.  You will also
need to configure / annotate an "input" result.  I can't remember off the
top of my head if you need to implement ValidationAware as well in order to
get the methods to add errors and messages.

-bill

On Thu, Nov 13, 2008 at 9:36 AM, Burton Rhodes <burtonrhodes@gmail.com>wrote:

> How do I use validation in an [Action]-validation.xml file to validate
> several fields?
>
> I need to implement the following logic for 3 fields on a form:
> Company, FirstName, LastName.
>
> Psedo Code:
>
> If Company empty, then FirstName and LastName must be filled
> If FirstName and LastName empty, then Company Must be filled.
>
> I am having trouble seeing how this can be accomplished with the
> "expression" validator type.
>
> Or should I just write some simple javascript to make this happen?!
>
> Thanks!!
> Burton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
-bill
816.841.4755

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