Followup: Stripes *does* process the validation annotations, but adds
validation errors under the key preferences.PAGE_SIZE instead of the
expected preferences[PAGE_SIZE].

On Mon, Aug 18, 2008 at 10:38 PM, Levi Hoogenberg
<[EMAIL PROTECTED]>wrote:

> Hi,
>
> today I've been binding into a Map for the first time using Stripes and I
> must say it was much less painful than I feared :) Now I'm trying to
> validate the map's contents by using something like:
>
>     @ValidateNestedProperties({
>         @Validate(field = "PAGE_SIZE", required = true)
>     })
>     private Map<Preference, String> preferences;
>
> Preference is an enum. This doesn't seem to work - is it supposed to work
> (and if so, how?), or is this use so rare that it's not supported? I've
> looked through the source code and I can't find any code that seems to deal
> with this, but then again, that part of Stripes is quite complex, IMO.
>
> Another quick question: I'm using clean URLs (who doesn't nowadays, thanks
> Ben) and one of my parameters is an enum value (a PreferenceCategory to be
> exact). Now the EnumeratedTypeConverter only understands the actual name()
> of enum constants. Since I write my constants in upper case, I'd end up with
> URLs like /members/preferences/DISPLAY, if I would use the default
> enumerated type converter. To avoid this, I subclassed the type converter.
> Now for the (not so quick anymore) question: would a hook in
> EnumeratedTypeConverter to tweak the input that would get sent to
> Enum.valueOf make sense, or would it be unnecessary since the user would be
> subclassing the type converter anyway? Another option would be to abstract
> this naming conversion into an interface so that the formatter could use it
> too (eg. for generating URLs), but that's just me thinking out loud.
>
>   Levi
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to