You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ja...@gmx.net on 2011/06/23 17:38:19 UTC

extval, @Past for Date date

Hello,

seems to be a bug of extval, the following is not working:

@Past(message = "...")
@Temporal(TemporalType.DATE)
private java.util.Date date;

Hibernate recognizes it correctly but I don't get a message in the JSF frontend. If I change the code to

@Past(message = "...")
@Temporal(TemporalType.DATE)
private java.util.Date dateOfSomething;

it behaves as supposed.

Ciao,
Jakob
-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

Re: extval, @Past for Date date

Posted by Gerhard Petracek <ge...@gmail.com>.
hi jakob,

here it works - see [1].
(it's just a demo generated by an archetype + the constellation you
mentioned)

regards,
gerhard

[1] http://people.apache.org/~gpetracek/myfaces/extval/demos/date-demo.zip

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/6/24 <ja...@gmx.net>

> Hi Gerhard,
>
> I think you got me wrong, I already used the hibernate validator. The
> problem is the name of the property:
>
> Date date;
> vs.
> Date dateOfSomething;
>
> The annotation of the bean property with name "date" is not recognized by
> extval, but the one of the property "dateOfSomething" is. Everything is
> working for me, except that I can't use properties named as "date". I can't
> believe that this is correct.
>
> Regards,
> Jakob
>
>
> -------- Original-Nachricht --------
> > Datum: Thu, 23 Jun 2011 18:12:08 +0200
> > Von: Gerhard Petracek <ge...@gmail.com>
> > An: MyFaces Discussion <us...@myfaces.apache.org>
> > Betreff: Re: extval, @Past for Date date
>
> > hi jakob,
> >
> > @Past is a bean-validation annotation.
> > myfaces-extval-bean-validation is just an adapter for bean-validation
> > which
> > adds additional features as well as bv-support for jsf 1.x.
> > so you have to add an implementation of bean-validation e.g. apache bval
> > or
> > hibernate validator v4 (besides the core and the bv module of extval) to
> > your project.
> > you can have a look at the examples [1] in the repository - e.g. [2] for
> > jsf2.
> >
> > regards,
> > gerhard
> >
> > [1] https://svn.apache.org/repos/asf/myfaces/extensions/validator/
> > [2]
> >
> https://svn.apache.org/repos/asf/myfaces/extensions/validator/tags/extval-2.0.4/examples/hello_bean-validation/pom.xml
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
> > 2011/6/23 <ja...@gmx.net>
> >
> > > Hello,
> > >
> > > seems to be a bug of extval, the following is not working:
> > >
> > > @Past(message = "...")
> > > @Temporal(TemporalType.DATE)
> > > private java.util.Date date;
> > >
> > > Hibernate recognizes it correctly but I don't get a message in the JSF
> > > frontend. If I change the code to
> > >
> > > @Past(message = "...")
> > > @Temporal(TemporalType.DATE)
> > > private java.util.Date dateOfSomething;
> > >
> > > it behaves as supposed.
> > >
> > > Ciao,
> > > Jakob
> > > --
> > > NEU: FreePhone - kostenlos mobil telefonieren!
> > > Jetzt informieren: http://www.gmx.net/de/go/freephone
> > >
>
> --
> NEU: FreePhone - kostenlos mobil telefonieren!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
>

Re: extval, @Past for Date date

Posted by ja...@gmx.net.
Hi Gerhard,

I think you got me wrong, I already used the hibernate validator. The problem is the name of the property:

Date date;
vs.
Date dateOfSomething;

The annotation of the bean property with name "date" is not recognized by extval, but the one of the property "dateOfSomething" is. Everything is working for me, except that I can't use properties named as "date". I can't believe that this is correct.

Regards,
Jakob


-------- Original-Nachricht --------
> Datum: Thu, 23 Jun 2011 18:12:08 +0200
> Von: Gerhard Petracek <ge...@gmail.com>
> An: MyFaces Discussion <us...@myfaces.apache.org>
> Betreff: Re: extval, @Past for Date date

> hi jakob,
> 
> @Past is a bean-validation annotation.
> myfaces-extval-bean-validation is just an adapter for bean-validation
> which
> adds additional features as well as bv-support for jsf 1.x.
> so you have to add an implementation of bean-validation e.g. apache bval
> or
> hibernate validator v4 (besides the core and the bv module of extval) to
> your project.
> you can have a look at the examples [1] in the repository - e.g. [2] for
> jsf2.
> 
> regards,
> gerhard
> 
> [1] https://svn.apache.org/repos/asf/myfaces/extensions/validator/
> [2]
> https://svn.apache.org/repos/asf/myfaces/extensions/validator/tags/extval-2.0.4/examples/hello_bean-validation/pom.xml
> 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces
> 
> 
> 2011/6/23 <ja...@gmx.net>
> 
> > Hello,
> >
> > seems to be a bug of extval, the following is not working:
> >
> > @Past(message = "...")
> > @Temporal(TemporalType.DATE)
> > private java.util.Date date;
> >
> > Hibernate recognizes it correctly but I don't get a message in the JSF
> > frontend. If I change the code to
> >
> > @Past(message = "...")
> > @Temporal(TemporalType.DATE)
> > private java.util.Date dateOfSomething;
> >
> > it behaves as supposed.
> >
> > Ciao,
> > Jakob
> > --
> > NEU: FreePhone - kostenlos mobil telefonieren!
> > Jetzt informieren: http://www.gmx.net/de/go/freephone
> >

-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

Re: extval, @Past for Date date

Posted by Gerhard Petracek <ge...@gmail.com>.
short addition:

i noticed that you are new here - so welcome @ myfaces!

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/6/23 Gerhard Petracek <ge...@gmail.com>

> hi jakob,
>
> @Past is a bean-validation annotation.
> myfaces-extval-bean-validation is just an adapter for bean-validation which
> adds additional features as well as bv-support for jsf 1.x.
> so you have to add an implementation of bean-validation e.g. apache bval or
> hibernate validator v4 (besides the core and the bv module of extval) to
> your project.
> you can have a look at the examples [1] in the repository - e.g. [2] for
> jsf2.
>
> regards,
> gerhard
>
> [1] https://svn.apache.org/repos/asf/myfaces/extensions/validator/
> [2]
> https://svn.apache.org/repos/asf/myfaces/extensions/validator/tags/extval-2.0.4/examples/hello_bean-validation/pom.xml
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
> 2011/6/23 <ja...@gmx.net>
>
> Hello,
>>
>> seems to be a bug of extval, the following is not working:
>>
>> @Past(message = "...")
>> @Temporal(TemporalType.DATE)
>> private java.util.Date date;
>>
>> Hibernate recognizes it correctly but I don't get a message in the JSF
>> frontend. If I change the code to
>>
>> @Past(message = "...")
>> @Temporal(TemporalType.DATE)
>> private java.util.Date dateOfSomething;
>>
>> it behaves as supposed.
>>
>> Ciao,
>> Jakob
>> --
>> NEU: FreePhone - kostenlos mobil telefonieren!
>> Jetzt informieren: http://www.gmx.net/de/go/freephone
>>
>
>

Re: extval, @Past for Date date

Posted by Gerhard Petracek <ge...@gmail.com>.
hi jakob,

@Past is a bean-validation annotation.
myfaces-extval-bean-validation is just an adapter for bean-validation which
adds additional features as well as bv-support for jsf 1.x.
so you have to add an implementation of bean-validation e.g. apache bval or
hibernate validator v4 (besides the core and the bv module of extval) to
your project.
you can have a look at the examples [1] in the repository - e.g. [2] for
jsf2.

regards,
gerhard

[1] https://svn.apache.org/repos/asf/myfaces/extensions/validator/
[2]
https://svn.apache.org/repos/asf/myfaces/extensions/validator/tags/extval-2.0.4/examples/hello_bean-validation/pom.xml

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/6/23 <ja...@gmx.net>

> Hello,
>
> seems to be a bug of extval, the following is not working:
>
> @Past(message = "...")
> @Temporal(TemporalType.DATE)
> private java.util.Date date;
>
> Hibernate recognizes it correctly but I don't get a message in the JSF
> frontend. If I change the code to
>
> @Past(message = "...")
> @Temporal(TemporalType.DATE)
> private java.util.Date dateOfSomething;
>
> it behaves as supposed.
>
> Ciao,
> Jakob
> --
> NEU: FreePhone - kostenlos mobil telefonieren!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
>