Re: Validation Questions

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Feb 22 2005 - 15:57:56 EST

  • Next message: Fredrik Liden: "RE: Validation Questions"

    Fredrik Liden <flide..ranslate.com> wrote:
    > Could someone give me some pointers on how to use Validation in a
    > project? If it's recommended at all.
    >
    > I have one jsp with a form and a servlet that processes an add action.
    > How would I use validation in this case?
    >
    > Wrap the add part with a try and catch? and requestdispatcher.
    > How would I track down failurs to individual objects to create a more
    > descriptive error message? Using if then statements? I'm sure there's a
    > better way right?

    Normally you perform validation and type conversion in your form processing
    logic. How that's done depends on what web app framework you're using.
    Commons Validator is one way to do this:
    http://jakarta.apache.org/commons/validator/

    > Also, if the validationException is thrown, do I need to call rollback
    > manually or is this done automaticallly?

    It's not automatic.
    If you want to throw everything out at that point, you'd call rollback
    manually.
    If you want to try to correct the error and recommit, you could do that as
    well.

    -Mike



    This archive was generated by hypermail 2.0.0 : Tue Feb 22 2005 - 15:57:10 EST