commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: using Validator in a non-Struts application
Date Thu, 30 Oct 2003 00:37:59 GMT

--- Michael Shaw <mikeshawnz@lycos.co.uk> wrote:
> Hi there, my apologies if this is the wrong forum for my questions, but
> I'm having trouble locating information about using Validator outside of
> Struts.
> My problem may stem directly from my misunderstanding of Validators'
> capabilities, but as I understand it Validator can generate
> error-messages from a pattern supplied by looking up the value of the
> "msg" attribute in a Validator element (in the validator-rules.xml) in
> the ValidatorResources instance.  My question is: does Validator perform
> this action itself (i.e. look up the error pattern and substitute the
> argument values into the pattern and return the resulting string) - if
> so, how do you invoke this?  Or is this all left as an exercise for the
> user?

Validator does not resolve message resource keys itself.  It only provides
the information to the surrounding application.  This allows a framework
like Struts to manage resources from multiple modules and multiple files. 
There is an example of using Validator in a standalone app. in the CVS
/src/example directory.

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/example/org/apache/commons/validator/example/

David

> I've looked through
> http://home.earthlink.net/~dwinterfeldt/overview.html#validatingOutsideO
> fStruts but it doesn't quite answer my question.  Any thoughts or links
> to relevant examples would be much appreciated.
> 
> Thanks in advance,
> MikeS
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message