You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christina Kaskoura <ch...@eurodyn.com> on 2013/10/10 09:25:40 UTC

CXF Bean Validation JAX-RS

Hello.

Can you please let me know if JSR303 integration made it into the latest 
CXF for JAX-RS 2.0? That wasn't the case back in January 
(http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E) 
but has anything changed in the last year or so?

Thank you,
Christina

Re: CXF Bean Validation JAX-RS

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 10/10/13 11:38, Christina Kaskoura wrote:
> Hi.
>
> I think I will give the interceptor solution a try then. Could you
> please let me know if the MessageContentsList.getContentsList(message)
> method returns the arguments in the order they where defined in the
> method signature or in some other (random) order (ex. depending on the
> order they where submitted to the HTTP call)?
>
In the method signature order,

Cheers, Sergey
> Christina
>
> On 10/10/2013 12:22, Sergey Beryozkin wrote:
>> Hi
>> On 10/10/13 10:13, David Karlsen wrote:
>>> You could use spring for this:
>>> http://docs.spring.io/spring/docs/3.2.4.RELEASE/javadoc-api/org/springframework/validation/beanvalidation/BeanValidationPostProcessor.html
>>>
>>>
>> Indeed; if the validation rules are simple then may be you can do the
>> CXF way too, use a custom CXF invoker or interceptor at the PRE-INVOKE
>> stage (see one of the last comments at CXF-5309)
>>
>> Sergey
>>>
>>> 2013/10/10 Christina Kaskoura <ch...@eurodyn.com>
>>>
>>>> Hi Sergey,
>>>>
>>>> Thanks for your reply. So until this feature is implemented is there
>>>> some
>>>> other suggested way to do bean validation in JAX-RS without doing it
>>>> manually? What I would like to be able to do (which is why I was
>>>> wondering
>>>> about JSR303 integration) is something like the following:
>>>>
>>>> @POST
>>>> @Path("foo")
>>>> @Produces("application/json")
>>>> public String registerUser(@NotNull @FormParam("username") String
>>>> userame)
>>>> {
>>>> ...
>>>> }
>>>>
>>>> Thank you,
>>>> Christina
>>>>
>>>>
>>>> On 10/10/2013 11:59, Sergey Beryozkin wrote:
>>>>
>>>>> Hi
>>>>> On 10/10/13 08:25, Christina Kaskoura wrote:
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> Can you please let me know if JSR303 integration made it into the
>>>>>> latest
>>>>>> CXF for JAX-RS 2.0? That wasn't the case back in January
>>>>>> (http://mail-archives.apache.**org/mod_mbox/cxf-users/201301.**
>>>>>> mbox/%3C50FD5D18.3010607@**gmail.com%3E<http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E>)
>>>>>>
>>>>>>
>>>>>> but has anything changed in the last year or so?
>>>>>>
>>>>>>   We have started looking into supporting JSR-349 (Bean Validation
>>>>>> 1.1),
>>>>> see
>>>>>
>>>>> https://issues.apache.org/**jira/browse/CXF-5309<https://issues.apache.org/jira/browse/CXF-5309>
>>>>>
>>>>>
>>>>> Cheers, Sergey
>>>>>
>>>>>> Thank you,
>>>>>> Christina
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>


Re: CXF Bean Validation JAX-RS

Posted by Christina Kaskoura <ch...@eurodyn.com>.
Hi.

I think I will give the interceptor solution a try then. Could you 
please let me know if the MessageContentsList.getContentsList(message) 
method returns the arguments in the order they where defined in the 
method signature or in some other (random) order (ex. depending on the 
order they where submitted to the HTTP call)?

Christina

On 10/10/2013 12:22, Sergey Beryozkin wrote:
> Hi
> On 10/10/13 10:13, David Karlsen wrote:
>> You could use spring for this:
>> http://docs.spring.io/spring/docs/3.2.4.RELEASE/javadoc-api/org/springframework/validation/beanvalidation/BeanValidationPostProcessor.html 
>>
>>
> Indeed; if the validation rules are simple then may be you can do the 
> CXF way too, use a custom CXF invoker or interceptor at the PRE-INVOKE 
> stage (see one of the last comments at CXF-5309)
>
> Sergey
>>
>> 2013/10/10 Christina Kaskoura <ch...@eurodyn.com>
>>
>>> Hi Sergey,
>>>
>>> Thanks for your reply. So until this feature is implemented is there 
>>> some
>>> other suggested way to do bean validation in JAX-RS without doing it
>>> manually? What I would like to be able to do (which is why I was 
>>> wondering
>>> about JSR303 integration) is something like the following:
>>>
>>> @POST
>>> @Path("foo")
>>> @Produces("application/json")
>>> public String registerUser(@NotNull @FormParam("username") String 
>>> userame)
>>> {
>>> ...
>>> }
>>>
>>> Thank you,
>>> Christina
>>>
>>>
>>> On 10/10/2013 11:59, Sergey Beryozkin wrote:
>>>
>>>> Hi
>>>> On 10/10/13 08:25, Christina Kaskoura wrote:
>>>>
>>>>> Hello.
>>>>>
>>>>> Can you please let me know if JSR303 integration made it into the 
>>>>> latest
>>>>> CXF for JAX-RS 2.0? That wasn't the case back in January
>>>>> (http://mail-archives.apache.**org/mod_mbox/cxf-users/201301.**
>>>>> mbox/%3C50FD5D18.3010607@**gmail.com%3E<http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E>) 
>>>>>
>>>>>
>>>>> but has anything changed in the last year or so?
>>>>>
>>>>>   We have started looking into supporting JSR-349 (Bean Validation 
>>>>> 1.1),
>>>> see
>>>>
>>>> https://issues.apache.org/**jira/browse/CXF-5309<https://issues.apache.org/jira/browse/CXF-5309> 
>>>>
>>>>
>>>> Cheers, Sergey
>>>>
>>>>> Thank you,
>>>>> Christina
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>


Re: CXF Bean Validation JAX-RS

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 10/10/13 10:13, David Karlsen wrote:
> You could use spring for this:
> http://docs.spring.io/spring/docs/3.2.4.RELEASE/javadoc-api/org/springframework/validation/beanvalidation/BeanValidationPostProcessor.html
>
Indeed; if the validation rules are simple then may be you can do the 
CXF way too, use a custom CXF invoker or interceptor at the PRE-INVOKE 
stage (see one of the last comments at CXF-5309)

Sergey
>
> 2013/10/10 Christina Kaskoura <ch...@eurodyn.com>
>
>> Hi Sergey,
>>
>> Thanks for your reply. So until this feature is implemented is there some
>> other suggested way to do bean validation in JAX-RS without doing it
>> manually? What I would like to be able to do (which is why I was wondering
>> about JSR303 integration) is something like the following:
>>
>> @POST
>> @Path("foo")
>> @Produces("application/json")
>> public String registerUser(@NotNull @FormParam("username") String userame)
>> {
>> ...
>> }
>>
>> Thank you,
>> Christina
>>
>>
>> On 10/10/2013 11:59, Sergey Beryozkin wrote:
>>
>>> Hi
>>> On 10/10/13 08:25, Christina Kaskoura wrote:
>>>
>>>> Hello.
>>>>
>>>> Can you please let me know if JSR303 integration made it into the latest
>>>> CXF for JAX-RS 2.0? That wasn't the case back in January
>>>> (http://mail-archives.apache.**org/mod_mbox/cxf-users/201301.**
>>>> mbox/%3C50FD5D18.3010607@**gmail.com%3E<http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E>)
>>>>
>>>> but has anything changed in the last year or so?
>>>>
>>>>   We have started looking into supporting JSR-349 (Bean Validation 1.1),
>>> see
>>>
>>> https://issues.apache.org/**jira/browse/CXF-5309<https://issues.apache.org/jira/browse/CXF-5309>
>>>
>>> Cheers, Sergey
>>>
>>>> Thank you,
>>>> Christina
>>>>
>>>
>>>
>>>
>>
>
>


Re: CXF Bean Validation JAX-RS

Posted by David Karlsen <da...@gmail.com>.
You could use spring for this:
http://docs.spring.io/spring/docs/3.2.4.RELEASE/javadoc-api/org/springframework/validation/beanvalidation/BeanValidationPostProcessor.html


2013/10/10 Christina Kaskoura <ch...@eurodyn.com>

> Hi Sergey,
>
> Thanks for your reply. So until this feature is implemented is there some
> other suggested way to do bean validation in JAX-RS without doing it
> manually? What I would like to be able to do (which is why I was wondering
> about JSR303 integration) is something like the following:
>
> @POST
> @Path("foo")
> @Produces("application/json")
> public String registerUser(@NotNull @FormParam("username") String userame)
> {
> ...
> }
>
> Thank you,
> Christina
>
>
> On 10/10/2013 11:59, Sergey Beryozkin wrote:
>
>> Hi
>> On 10/10/13 08:25, Christina Kaskoura wrote:
>>
>>> Hello.
>>>
>>> Can you please let me know if JSR303 integration made it into the latest
>>> CXF for JAX-RS 2.0? That wasn't the case back in January
>>> (http://mail-archives.apache.**org/mod_mbox/cxf-users/201301.**
>>> mbox/%3C50FD5D18.3010607@**gmail.com%3E<http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E>)
>>>
>>> but has anything changed in the last year or so?
>>>
>>>  We have started looking into supporting JSR-349 (Bean Validation 1.1),
>> see
>>
>> https://issues.apache.org/**jira/browse/CXF-5309<https://issues.apache.org/jira/browse/CXF-5309>
>>
>> Cheers, Sergey
>>
>>> Thank you,
>>> Christina
>>>
>>
>>
>>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: CXF Bean Validation JAX-RS

Posted by Christina Kaskoura <ch...@eurodyn.com>.
Hi Sergey,

Thanks for your reply. So until this feature is implemented is there 
some other suggested way to do bean validation in JAX-RS without doing 
it manually? What I would like to be able to do (which is why I was 
wondering about JSR303 integration) is something like the following:

@POST
@Path("foo")
@Produces("application/json")
public String registerUser(@NotNull @FormParam("username") String userame) {
...
}

Thank you,
Christina


On 10/10/2013 11:59, Sergey Beryozkin wrote:
> Hi
> On 10/10/13 08:25, Christina Kaskoura wrote:
>> Hello.
>>
>> Can you please let me know if JSR303 integration made it into the latest
>> CXF for JAX-RS 2.0? That wasn't the case back in January
>> (http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E) 
>>
>> but has anything changed in the last year or so?
>>
> We have started looking into supporting JSR-349 (Bean Validation 1.1),
> see
>
> https://issues.apache.org/jira/browse/CXF-5309
>
> Cheers, Sergey
>> Thank you,
>> Christina
>
>


Re: CXF Bean Validation JAX-RS

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 10/10/13 08:25, Christina Kaskoura wrote:
> Hello.
>
> Can you please let me know if JSR303 integration made it into the latest
> CXF for JAX-RS 2.0? That wasn't the case back in January
> (http://mail-archives.apache.org/mod_mbox/cxf-users/201301.mbox/%3C50FD5D18.3010607@gmail.com%3E)
> but has anything changed in the last year or so?
>
We have started looking into supporting JSR-349 (Bean Validation 1.1),
see

https://issues.apache.org/jira/browse/CXF-5309

Cheers, Sergey
> Thank you,
> Christina


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com