-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Custom code for JSR 303 Validation
PostPosted: Sun Mar 21, 2010 1:03 am 
Newbie

Joined: Sun Mar 21, 2010 12:55 am
Posts: 1
Hi,

I am using Validator 4.0.2.GA along with Spring. I would like to set a custom code for the validation instead of the default codes...

for example....

@NotNull (code="object.field.notNull.code") however, I have not found a way to do so. Is it possible to do this?

The core issue is that we do not have control of the codes and these are predefined to be used with the rest of the spring message source.


Top
 Profile  
 
 Post subject: Re: Custom code for JSR 303 Validation
PostPosted: Wed Mar 24, 2010 6:13 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Not exactly sure what you mean with "code". If you want to customize the message texts for constraints, you can do that by providing a resource bundle "ValidationMessages". More information can be found in the HV reference guide:

http://docs.jboss.org/hibernate/stable/ ... erpolation

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.