Jonathan,
Like you said, it appears that the consensus is for this validation
information to be stored in xml. However, in practice some issues makes this
incovenient.
If you take a field lets say order.date, you may end up having entries in
the property file like:
order.date.prompt=Order Date:
order.date.error.required=Order date must be entered
order.date.error.validate=Invalid date range or format
Rather than placing the validation information in another file, it is easier
to add entries like these:
order.date.mask=YYYY/MM/DD
order.date.regexp=/^applicable regular Expression/
Furthermore, this information may vary, depending on locale. Property file
will automatically take care of this.
It was for these reasons, that we found it more amenable for the validation
information to be in the property file.
That said, my initial question is whether there is a utility out there, that
would allow me to pick a field like order.date, and I would get all it
corresponding entries (like a property sheet), on a read and write basis.
Also, a source editor, that would allow auto complete on these entries, and
allow insertion into the property file, while editing.
Forte for Java has features close to this requirement, but it appears to
only work for Java source and not JSP.
Akin
-----Original Message-----
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 10:18 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: server-side, java-based validation rules for struts..
I thought that the point was to NOT have to use a property editor, but
rather an xml file
----- Original Message -----
From: "Nick Afshartous" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 9:24 AM
Subject: RE: server-side, java-based validation rules for struts..
>
> Cook, Levi writes:
> > IMHO, expressing rules using first class Java objects *can* be just as
> > flexible as defining rules in an XML file.
> >
> > The analog to changing a value in an XML file is using a property
editor to
> > change values stored in a JavaBean (thus avoiding recompiling). The
upside
> > of this approach is simpler integration with visual editors (simply
> > implement a property editor for your form-bean).
>
> > Ultimately, I feel this is
> > where your less technical people can begin to contribute more
effectivly.
> > The other route requires hand-rolling a visual editor for your XML
scheme
> > and/or having your users learn quite a bit about the intricacies of
your
> > schema.
>
> Thanks Levi for pointing out that a property editor could be used.
> Could one also add new rules and attributes dynamically with a
> property editor ?
>
> Maybe the trickiest part for the users would be to learn the
> syntax for rule expressions. In particular how to refer
> to object attributes within a rule.
> --
>
> Nick
>
>
>