If I use stripes in-built annotation validation on action beans, is there a
way I can specify the error messages? I remember that stripes uses the field
name and some combination to display the error message for inbuilt
annotation validation. Is there a way to over ride this?
--
Cheers,
Abhi
I saw that it can be done. My apologies for cluttering the mailing list.
On Thu, Nov 12, 2009 at 11:44 AM, Abhi wrote:
> If I use stripes in-built annotation validation on action beans, is there a
> way I can specify the error messages? I remember that stripes uses the field
> name and some comb
Hi Abhi,
yes you can. You need two entries in your resource bundle: One for a
generic error message and one for the field name.
validation.required.valueNotPresent = {0} is requierd
fieldname = Field Name
Have a look at
http://www.stripesframework.org/display/stripes/Localization chapter
"Loc
Jan Künstler wrote:
> Hi Abhi,
>
> yes you can. You need two entries in your resource bundle: One for a
> generic error message and one for the field name.
>
> validation.required.valueNotPresent = {0} is requierd
> fieldname = Field Name
there is one issue with that behaviour: it creates lots of
Maybe instead of:
order.user.userId=User name
invoice.user.userId=User name
you can just use:
userId=User name
For me it wouldn't be worth extending the annotation to save some
entries in the resource bundle even if it means duplicates.
Greets
Jan
Lionel schrieb:
> Jan Kü
Wouldn't it be great if the value would be used for
errors for that field?
If we have something like:
User name
Hmm... this sounds great 'till I thought about implementing this. I
guess we must pass the label value with every form-submit. I can think
of people who will not like the idea :=)
I'm not sure if you mean it would be great because it would ease programming
or because you could put the error near the field. If it is the latter, then
you can do this:
User name
Take a look at the stripes.fieldErrors.* group of properties in
StripesResource.properties to format field errors
Jan Künstler wrote:
> Maybe instead of:
> order.user.userId=User name
> invoice.user.userId=User name
> you can just use:
>userId=User name
Would be great if it worked ;)
Unfortunately, the last attempt made to find the label is "fieldname" and
not "fieldname after last do