Hello,
I tried to setup custom messages for the hibernate validation annotation but
without success yet.
I have a ValidatorMessages.properties (defining all the default message for
hibernate validators) file in my ear file so that I don't get an exception at
server startup.
All my properties
Richard
read the thread
http://www.jboss.com/index.html?module=bbop=viewtopict=93507
to get some more explanations about NotNull annotation and validation tag.
Pierre
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3988670#3988670
Reply to the post :
Hi Pierre,
Thanks for the link, I'm going to take a look at it.
Richard
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3988685#3988685
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3988685
Yes, Hibernate Validator wants you to use:
@NotNull(message={booking.credit.card.not.null})
However, Emmanuel and I are currently working on some integration b/w Seam and
Hibernate Validator so that you can use #{messages['...']} for consistency.
View the original post :
ATM, in a deploiement under jBoss server,
@NotNull(message=#{messages['booking.credit.card.not.null']})
works with messages_loc.properties under
{booking_home}/resources/WEB-INF/classes
and
@NotNull(message={booking.credit.card.not.null})
doesn't work even with
Oh, I'm wrong, #{messages['booking.credit.card.not.null']} does work after all.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3971660#3971660
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971660
Ok
So I come back to my first question: I get the literal string
#{message['any.key']}
and not the associated pattern when I test BookingTest.renderResponse
is it the expected behavior?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3971664#3971664
Reply
message!=messages
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3971680#3971680
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971680
___
jboss-user mailing list
Oups! Sorry, the mistake is only here. The code is really like:
@Length(min=16, max=16,
message=#{messages['booking.credit.card.number.wrong.length']})
and during test, ( (FacesMessage) messages.next() ).getSummary() returns
#{messages['booking.credit.card.number.wrong.length']}