Re: [JAX-RS] Best practice for update methods

2015-06-10 Thread Sergey Beryozkin
Hi Francesco, thanks for the confirmation, @BeanParam refers to a bean which captures parameters like query, path, header, matrix or any of JAX-RS contexts, but not the actual body. Cheers, Sergey On 10/06/15 14:57, Francesco Chicchiriccò wrote: On 09/06/2015 15:34, Francesco Chicchiriccò wrot

Re: [JAX-RS] Best practice for update methods

2015-06-10 Thread Francesco Chicchiriccò
On 09/06/2015 15:34, Francesco Chicchiriccò wrote: On 09/06/2015 15:17, Sergey Beryozkin wrote: Hi Francesco See https://issues.apache.org/jira/browse/CXF-6447, So you'd be able to optimize the signature if still preferred, the server code would stay completely portable, though only CXF proxie

Re: [JAX-RS] Best practice for update methods

2015-06-09 Thread Francesco Chicchiriccò
On 09/06/2015 15:17, Sergey Beryozkin wrote: Hi Francesco See https://issues.apache.org/jira/browse/CXF-6447, So you'd be able to optimize the signature if still preferred, the server code would stay completely portable, though only CXF proxies would likely to work with such signatures in the

Re: [JAX-RS] Best practice for update methods

2015-06-09 Thread Sergey Beryozkin
Hi Francesco See https://issues.apache.org/jira/browse/CXF-6447, So you'd be able to optimize the signature if still preferred, the server code would stay completely portable, though only CXF proxies would likely to work with such signatures in the short term at least Thanks, Sergey On 08/06/

Re: [JAX-RS] Best practice for update methods

2015-06-08 Thread Sergey Beryozkin
Sorry, that will not work with the proxies as they won't be able to resolve the {key} :-), with webclients only... I wonder if we can explore your idea on the client side and try to resolve a variable if the body bean is available...I'll try to experiment a bit later on Thanks, Sergey On 0

Re: [JAX-RS] Best practice for update methods

2015-06-08 Thread Sergey Beryozkin
Hi Francesco, By the way, it is fine to have something like this: @PUT @Path("{key}") public void update(ResourceTo bean) {} That can actually be the optimal signature, if the bean contains the key then it can be taken from the bean and if not - then from UriInfo by analyzing the path value.

Re: [JAX-RS] Best practice for update methods

2015-06-08 Thread Francesco Chicchiriccò
Hi Sergey, thanks for your response. On 08/06/2015 11:16, Sergey Beryozkin wrote: Hi Francesco Sure, you can try: @PUT @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) void update(@NotNull ResourceTO resourceTO); Omitting the extra @Path completely and getting the key out

Re: [JAX-RS] Best practice for update methods

2015-06-08 Thread Sergey Beryozkin
Hi Francesco Sure, you can try: @PUT @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) void update(@NotNull ResourceTO resourceTO); Omitting the extra @Path completely and getting the key out of ResourceTo bean: PUT /resources 1 given that the key is available the

[JAX-RS] Best practice for update methods

2015-06-07 Thread Francesco Chicchiriccò
Hi, we have several "update" methods in our JAX-RS services, with similar signature: @PUT @Path("{key}") @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("key") String key, @NotNull ResourceTO resourceTO); For various reason