Perfect, thanks Sergey!

Cheers,


2014-04-02 16:28 GMT+02:00 Sergey Beryozkin <[email protected]>:

> Hi
>
> On 02/04/14 15:11, Adrián Roselló Rey wrote:
>
>> Hi all,
>>
>> Is it possible to export same java method in a specific path with two
>> different http methods through REST-WS?
>>
>> In order to illustrate what i want to do, I include a non-working
>> configuration for what I want to do:
>>
>>
>>
>>
>>
>> *@POST@PUT@Consumes(MediaType.APPLICATION_XML)@Path("/all")public void
>> mymethod(Blabla blabla);*
>>
>>
>> I know it should be exposed by different methods, since the meaning of a
>> POST and a PUT in REST differs, but the specification of the third-party
>> software can not be modified.
>>
>>
> You can only have it done like this:
>
> @POST
> public aPost() { handlePostPut();}
>
> @PUT
> public aPut() { handlePostPut();}
>
> or have a single method, say POST-annotated only, and have a PreMatching
> filter which will change PUT to POST to ensure the matching works...
>
> HTH, Sergey
>
>  Thanks a lot!
>>
>>
>


-- 


*Adrián Roselló Rey Distributed Applications and Networks Area (DANA) i2CAT
Foundation, Barcelona, Spain*

Reply via email to