commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnold, Patrick" <>
Subject Validator - Validation Rules at Runtime from DB
Date Tue, 28 Nov 2006 12:40:31 GMT

i'm working on a project, where attributes and entities are stored in
different tables. The reason therefore is, that attributes depend on the
type of an entity. e.g. For a lorry you may need an attribute
"load_in_kg", for a cabriolet this isn't very important, instead you
need the attribute "fun_factor". Such as this:

table "vehicle"
ID    name             vehicle_type_id
1    volvo g38         5
2    mercedes slk     6
3    dodge viper      7

table "vehicle_type"
ID   name
5    lorry         
6    cabriolet
7    hellraiser

table "vehicle_attributes"
ID    name                vehicle_type_id    required
1     load_in_kg         5                          yes
2     fun_factor         6                          yes
3     horsepower       6                          no
4     acceleration       7                          yes

My idea for validating the attributes dependent on the vehicle_type is
to read the attributes at runtime and generate a String which looks like
"validation.xml". Now i want to validate the form submission with this
XML-String. Is there a possibility to do this in the
SimpleFormController (Spring MVC) or has anyone a better approach to
come along with this problem?

Thanks in Advance,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message