-->
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: Get validation result in more languages
PostPosted: Thu Dec 12, 2013 5:55 am 
Newbie

Joined: Thu Dec 12, 2013 5:48 am
Posts: 1
Hi,

I need to validate some beans and get the validation result in 3 languages simultaneously (I need to return them to a WS call). How can I do this?
I found the class LocaleSpecificMessageInterpolator where I can specify the Locale to use, but this is not what I want as I would have to call the validation 3 times (for every language).
Implementing my own MessageInterpolator also seems not to be an option as the method interpolate(...) returns only a simple String.

Thanks
Matt


Top
 Profile  
 
 Post subject: Re: Get validation result in more languages
PostPosted: Mon Dec 16, 2013 8:32 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Bean Validation doesn't really support to create several messages at once for a given constraint violation. You might try to create a custom interpolator which returns several messages encoded into one String separated by a special delimiter character. You'd then have to split that message using that delimiter in the code invoking the validation engine. That's just a quick thought, haven't tried it out so I'm not sure whether you'd hit any road blocks with that approach.

--Gunnar

_________________
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.