You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by vickatvuuch <vl...@gmail.com> on 2009/11/23 18:07:41 UTC
CXF bean property validation
Hi All,
Does anybody know if there is a standard way to deal with property
validation?
For example if my request POJO has N properties can I somehow enforce
validation
of things such as String length, null, Not Null etc. Common stuff..
Just don't want to reinvent the wheel in case CXF already has it built in?
Thanks,
-Vitaly
--
View this message in context: http://old.nabble.com/CXF-bean-property-validation-tp26482127p26482127.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF bean property validation
Posted by Josef Dabernig <jo...@c3mundos.org>.
maybe, you could avoid data layer hits by using interceptors or
requesthandlers for the validation task
On 11/24/2009 05:14 AM, vickatvuuch wrote:
> Thanks for the link; we have sort of decided to let hibernate do it, I
> thought of web services layer
> validation as to avoid unnecessary data layer hits, but it may be not such a
> big deal.
>
>
> Josef Dabernig-4 wrote:
>
>> hello vitaly,
>>
>> i don't know, if cfx has such a thing.
>>
>> maybe hibernate validator
>> https://www.hibernate.org/412.html
>>
>> i used it sucessfully two years ago, but i can't tell about the current
>> state, as things seem to be changing because of JSR 303: Bean Validation
>> http://jcp.org/en/jsr/detail?id=303
>>
>> regards, josef
>>
>> On 11/23/2009 06:07 PM, vickatvuuch wrote:
>>
>>> Hi All,
>>>
>>> Does anybody know if there is a standard way to deal with property
>>> validation?
>>> For example if my request POJO has N properties can I somehow enforce
>>> validation
>>> of things such as String length, null, Not Null etc. Common stuff..
>>> Just don't want to reinvent the wheel in case CXF already has it built
>>> in?
>>>
>>> Thanks,
>>> -Vitaly
>>>
>>>
>>
>>
>
Re: CXF bean property validation
Posted by vickatvuuch <vl...@gmail.com>.
Thanks for the link; we have sort of decided to let hibernate do it, I
thought of web services layer
validation as to avoid unnecessary data layer hits, but it may be not such a
big deal.
Josef Dabernig-4 wrote:
>
> hello vitaly,
>
> i don't know, if cfx has such a thing.
>
> maybe hibernate validator
> https://www.hibernate.org/412.html
>
> i used it sucessfully two years ago, but i can't tell about the current
> state, as things seem to be changing because of JSR 303: Bean Validation
> http://jcp.org/en/jsr/detail?id=303
>
> regards, josef
>
> On 11/23/2009 06:07 PM, vickatvuuch wrote:
>> Hi All,
>>
>> Does anybody know if there is a standard way to deal with property
>> validation?
>> For example if my request POJO has N properties can I somehow enforce
>> validation
>> of things such as String length, null, Not Null etc. Common stuff..
>> Just don't want to reinvent the wheel in case CXF already has it built
>> in?
>>
>> Thanks,
>> -Vitaly
>>
>
>
--
View this message in context: http://old.nabble.com/CXF-bean-property-validation-tp26482127p26490248.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF bean property validation
Posted by Josef Dabernig <jo...@c3mundos.org>.
hello vitaly,
i don't know, if cfx has such a thing.
maybe hibernate validator
https://www.hibernate.org/412.html
i used it sucessfully two years ago, but i can't tell about the current
state, as things seem to be changing because of JSR 303: Bean Validation
http://jcp.org/en/jsr/detail?id=303
regards, josef
On 11/23/2009 06:07 PM, vickatvuuch wrote:
> Hi All,
>
> Does anybody know if there is a standard way to deal with property
> validation?
> For example if my request POJO has N properties can I somehow enforce
> validation
> of things such as String length, null, Not Null etc. Common stuff..
> Just don't want to reinvent the wheel in case CXF already has it built in?
>
> Thanks,
> -Vitaly
>
Re: CXF bean property validation
Posted by Daniel Kulp <dk...@apache.org>.
The NORMAL way for this is to have all that defined in the schema and then
turn on the schema validation. At parse time, the xml parser will validate
the XML based on the schema and fail if invalid.
Only really works well for the xsd first cases though as JAXB doesn't provide
enough annotations to really control all of that.
Dan
On Mon November 23 2009 12:07:41 pm vickatvuuch wrote:
> Hi All,
>
> Does anybody know if there is a standard way to deal with property
> validation?
> For example if my request POJO has N properties can I somehow enforce
> validation
> of things such as String length, null, Not Null etc. Common stuff..
> Just don't want to reinvent the wheel in case CXF already has it built in?
>
> Thanks,
> -Vitaly
>
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog