Hi

Struts supports localized validation by having multiple <formset>'s in validation.xml - one for each "known" locale and one fallback/default for "unknown" locales.

E.g.

validation.xml:
...
<formset>
...
</formset>
<formset language="en" country="GB">
...
</formset>
<formset language="da">
...
</formset>
...

In the default <formset> you insert the default validation rules and then only overrides the changed rules in the various localized <formset>'s. In the above example that could be override the postalcode format in the british locale and the postal code and date formats in the danish locale.

This is great for validation of localized input like dates and floats, but isn't supported by XDoclet that will only create the default <formset>...

I'm considering improving XDoclet/validation_xml.xdt with ability to handle locales.

I was thinking of the following design:

Adding three parameters to @struts.validator; language, country and variant.

Then I'll extend validation_xml.xdt to do the following:
1. Find all the fields without language, country or variant and create the default <formset>. (Almost the current behaviour).
2. Find all the combinations of language, country and variant used in all classes.
3. Foreach combination create a <formset> containing only the field's different from the default.


As I'm a xdt/XDoclet programming newbie I would like to here somebody's opinion about:
- Can this be done with xdt?
- Is this too difficult for a starters project?


/Christian Bjørnbak


------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to