users@glassfish.java.net

Re: _at_Email not available in javax.validation.constraints ...

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Mon, 26 Oct 2009 21:36:04 +0100

aaah: "In the above case the constraint is user-defined"

sorry, now I see.. thanks........



2009/10/26 Felipe Gaścho <fgaucho_at_gmail.com>:
> but here: http://java.sun.com/javaee/6/docs/tutorial/doc/gircz.html
>
> it says Email.. I was looking for this annotation..........
>
> On Mon, Oct 26, 2009 at 9:24 PM, Nandini Ektare <Nandini.Ektare_at_sun.com> wrote:
>> Hi,
>>
>> Felipe Gaścho wrote:
>>>
>>> is @Email available in the javax.validation.constraints package ??
>>>
>>
>> I don't see it as a standard constraint in Bean validation API which is what
>> GFv3's configuration adheres to (Hibernate however has a custom one in their
>> impl - org.hibernate.validator.constraints.Email) .
>>>
>>> if yes, how to use it ?
>>>
>>
>> If you wan't to avoid using hibernate's impl, it will have to be a custom
>> constraint. Please see JSR 303 spec guidelines/examples to create a new
>> annotation (it's pretty straightforward).
>>>
>>> what maven dependency should I use  to have this constraint available ?
>>>
>>
>> Depending on where you intend to use that annotation, you may have to use
>> this dependency:
>>     <dependency>
>>           <groupId>org.glassfish</groupId>
>>           <artifactId>bean-validator</artifactId>
>>           <version>3.0-JBoss-4.0.1_01</version>
>>       </dependency>
>>
>> Modules that already have dependency on hk2 config (such as
>> v3/admin/config-api) already have this dependency included transitively.
>> In that case, you would only need to make sure that the custom classes are
>> available to the module
>>
>> Nandini
>>>
>>> can I use it only with JSF 2 or also with the java ee ManagedBean  ?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
>
>
> --
> Looking for a client application for this service:
> http://fgaucho.dyndns.org:8080/arena-http/wadl
>



-- 
Looking for a client application for this service:
http://fgaucho.dyndns.org:8080/arena-http/wadl