addFieldError("fieldName","message");  will add a specific field
error.  If you are using the XHTML theme, the error will appear above
the field.

This should set and clear the validation message for you.  If you are
using the simple theme you have to add the s:fielderror tag.


On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to set up my own validate method to validate fields in my own way, but 
> I'm not sure how to set up the method.  I don't know how to set or clear the 
> validation error message.  Is it ok just to use the action's error stack, 
> like this:
>
> public void validate() {
>   if (listOfExistingElement.contains(field1)) {
>     addActionError("This element already exists");
>   }
> }
>
> Is there a better way to make use of the framework, or is this it?  I 
> searched for examples online but couldn't find any.
>
> Thanks for the push,
> Session
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to