-->
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.  [ 5 posts ] 
Author Message
 Post subject: [Hibernate Validator] @CreditCardNumber not working
PostPosted: Wed Jul 11, 2007 12:37 pm 
Newbie

Joined: Mon Apr 23, 2007 6:57 pm
Posts: 12
Hi,

I'm using seam 1.2.1 and tried it with both Jboss AS 4.0.5 and 4.2. The hibernate validator @CreditCardNumber is not validating the credit card number form input.

I did look deep in to it and found out the hibernate-annotations.jar used by JBoss has validator classes in it. But I do not see CreditCardNumber class in the jar file. I think JBoss(both 4.0.5 and 4.2) is using an old version hibernate-validator classes. Even other validators like @Digits etc. are not part of it. So I think it is not seam problem.

Has anyone come across this issue? How do I use the latest version of hibernate-validator? I tried updating the one used by Jboss but it didn't seem to like it. I hoped 4.2 might be using the latest one but it does not either.

I tried adding the jar in WEB-INF/lib of my application but it does not work either.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I know it's lame I fought for it.
replace in JBOSS_HOME/server/default/lib
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-validator.jar

It should work

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 7:49 pm 
Newbie

Joined: Mon Apr 23, 2007 6:57 pm
Posts: 12
emmanuel wrote:
I know it's lame I fought for it.
replace in JBOSS_HOME/server/default/lib
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-validator.jar

It should work


Thanks. I also had to replace hibernate3.jar and it worked.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 9:27 pm 
Newbie

Joined: Mon Apr 23, 2007 6:57 pm
Posts: 12
I see the following behaviour with using @CreditCardNumber:

If the number has all alphabets, it does not do any validation. Is it a known behaviour?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 8:49 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hum it inherits the Luhn algorithm implementation that needs to discard alphabetic data.
My idea to inherit this feature was to handle
1234567890123456
1234 5678 9012 3456
1234-5678-9012-3456

etc

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.