|
From: Michael M. <mmu...@re...> - 2011-02-09 14:22:46
|
You need the QueryParam annotation as in:
public Response foo(@QueryParam("name")String name,
@QueryParam("num")String num) {...}
Mike
> Hello!
> I've been testing the JBoss JAX-RS implementation Resteasy.
> First I began with the last version userguide (
> http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html
> <http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html>
> ), but I don't know how to use it or if I don't understand the docs.
> Section number 6, speaking about the** *@QueryParam* anotation, tolds
> literal:
>
> /Currently since Resteasy is built on top of a Servlet, it does not
> distinguish between URI query strings or url form encoded paramters. /
>
> As I understand, it's telling that it can read those parameters
> included in the URI ( *http://example.com/test?name=Foo&num=4*
> <http://example.com/test?name=Foo&num=4> ) and those that come in the
> content of a request POST method (
> *Content-Type=application/x-www-form-urlencoded* , and the content
> *name=Foo&num=4* )
>
> Following the example in the userguide, I can't get the parameters if
> the request is a POST method with the content.
>
> Moreover, in the API definition of the *@QueryParam* doesn't speaks
> about the url form encoded params, and in fact there is another
> annotation called *@FormParam* .
>
> So, the question: is there anyway of getting the params coming from
> URI query or form encoded?
> Thanks!
>
> --
> Lucas
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
>
>
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|