On Thu, Jan 22, 2009 at 11:12 AM, Dave Newton <newton.d...@yahoo.com> wrote:
> Richard Sayre wrote:
>>
>> First I wrote a method called validate.  At this point I found out
>> that I was overriding the ActionSupport method.  When I tried to find
>> more information on this method I couldn't.  When I search for XWork
>> or Struts 2 validation I always get the XML or Annotated validation.
>> These validations are too simple for the needs of this particular
>> form.
>>
>> Where can I find out more information on how to implement the validate()
>> method?
>
> What do you want to know? The ValidationAware interface API docs list the
> methods available, most of which are self-explanatory.

The validate method comes from com.opensymphony.xwork2.Validateable
and is implemented by com.opensymphony.xwork2.ActionSupport.

The API description from each is :
void validate()    Performs validation.
void validate()   A default implementation that validates nothing.
Subclasses should override this method to provide validations.

I was wondering if this works with Struts 2?  I can't find anything
outside of XML and Annotated validation when I search.  Will it work
with built in Ajax validation?  If yes, do I implement the validate
method using the ValidationAware API?

>> Will this method work with Ajax validation?
>
> I still don't know--if you're already doing Ajax validation, and already
> have a validate() method, wouldn't you already have found out?

I have a validateData method.  I didnt use validate because I wasn't
aware on how the valdate method is used with Struts.

>> Will this require less work on my part if I do this?
>
> Less work than what?

Less work than my solution. JSON Plugin + Dojo.  It wasn't alot of
work to do this I just want to make sure I am not rewriting something
that Struts 2 already provides.

>> By creating the mechanism for populating the <s:fieldError/> did
>
>> I rewrite somethign that Struts can do for me?
>
> AFAIK the Ajax validation as shipped only deals with field-specific errors,
> not the entire collection of errors--but I've never tried that, so I'm not
> really sure. Somebody with more experience doing that may know.

I am using the field specific errors, I am just handling them
differently.  If the shipped version works with the validation
javascript provided in the struts.jar then it should work with my
code.  I kept the same js functions.

> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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

Reply via email to