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!


Reply via email to