-->
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: Create ValidatorFactory in Application Scope
PostPosted: Tue Nov 09, 2010 5:32 pm 
Newbie

Joined: Tue Nov 09, 2010 5:29 pm
Posts: 1
Hello,

I have a simple web application project. Is it possible to create the ValidatorFactory in ApplicationScope (e.g. configure in web.xml)?


Top
 Profile  
 
 Post subject: Re: Create ValidatorFactory in Application Scope
PostPosted: Wed Nov 10, 2010 5:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Sure that is possible. You can programmatically bootstrap Bean Validation and create a ValidatorFactory. Refer to the online documentation of Hibernate Validator on how to do this.
If you want to do this at application startup of a web application I recommend implementing a ServletContextListener and add the listener to your web.xml. In the listener implementation you can then create the factory and store it in the context.

--Hardy


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.