Discussions

News: Excerpt: Jakarta Commons Online Bookshelf, Validator

  1. This excerpt from Manning's Jakarta Commons Online Bookshelf, by Vikram Goyal, covers Validator, a component that streamlines and centralizes validation mechanisms for Java. The excerpt follows the general pattern the rest of the Jakarta Commons Online Bookshelf uses, including the justification for the component, its requirements, and simple usage of the component.

    The table of contents is:
    • The data validation process
    • The Validator component
    • Validator in action
    • Summary

    Download Jakarta Commons Online Bookshelf, Validator

    Threaded Messages (6)

  2. May I suggest:

    http://www.sapia-oss.org/projects/vlad/

    An alternative is always handy...
  3. The nice thing I got immediately from this book is that the validator can be used outside the struts context.
    Though it seems trivial, in my mind the validator was coupled with struts.

    D. Orbach
    javasight - java news & books
    booksprice - Multiple Book Comparison
  4. Validator - Not just for struts[ Go to top ]

    i've used the commons validator to handle input pojo classes to a stateless session bean. once other clients began to call the beans, the bean could no longer trust the data is valid.

    it takes a bit of work to pull out the existing validations that struts has already. you don't get many validations with the vanilla commons validator iirc. one thing that comes to mind is "required if", if a street address is specified, then city, state and zip are also required, and 2nd street is optional. etc.

    also, getting xdoclet to work with the pojo validator took a small tweaking on the xdoclet side of things. it slips my mind if it was in the xdoclet code itself or in the template files. once working though, generating the validation configuration was very very handy.
  5. Check out the Validation component syntax look familiar?

    http://jakarta.apache.org/tapestry/doc/DevelopersGuide/components.helper-beans.html

    Yes it's all Apache that is even cooler, I guess some roads are converging component wise.

    Friends don't let Friends Code struts...
  6. Sux[ Go to top ]

    Struts is total suxx.
    Commons validator is too cumbersome to use.
    I hate all those xml descriptors.
    I think near future is for AOP + Annotation to perform validation.
  7. Broken Link[ Go to top ]

    The link to the excerpt download is broken.