I had a similar case (the unusual overlap was dictated by the client
interface), but there's nothing wrong with writing 2 separate methods
(or a delegate if you really want to do the same, which I don't think)
and annotating one with @GET, the other with @POST, both with the same
path, like:

> @POST> @Path("/openchat")> public String echoPost(@QueryParam@FormParam 
> String message) {
>       // save message or whatever>       return message;> }
> @GET
> @Path("/openchat")
> public String echoGet(@QueryParam@FormParam String message) {
>       // retrieve message etc.
>       return message;
> }

HTH,
Gregor

2011/12/29 David Fehr <david...@gmail.com>:
> Hi all,
>
> maybe this question is stupid, but maybe there is an elegant way:
>
> Is it possible to annotate one method with @GET and @POST, while processing
> the parameters as previous with @FormParam and @QueryParam.
> The solution could look like this:
>
> @POST@GET
> @Path("/openchat")
> public String echo(@QueryParam@FormParam String message) {
>       return message;
> }
>
> Probably quite silly, but maybe there is a way. Otherwise i would to
> duplicate the method and delegate to my actual service.
> I would need this for supporting JSON and JSONP...
>
> Regards,
> David
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to