json - Converting data sent from the client with RESTeasy -


i developing rest services, in j2ee environment, using resteasy library. if have @post rest method:

@post @path("/filter") @produces(mediatype.application_json) @consumes(mediatype.application_form_urlencoded) public list<order> findorders(         @formparam("orderfiltercriteria") orderfiltercriteria orderfiltercriteria,          @formparam("readcontext") orderreadcontext readcontext,          @formparam("querycontrol") querycontrol querycontrol,          @formparam("fetchpattern") fetchpattern fetchpattern,          @formparam("loadpattern") loadpattern loadpattern) {     ... } 

supposing client sends these data through form, , supposing these json string, how can convert (server-side) these json strings in correct way? example, json string "readcontext" field, how can converted orderreadcontext object?

i using widlfly 8.2 deploy. in advance.

from @formparam documentation:

the type t of annotated parameter must either:

  1. be primitive type
  2. have constructor accepts single string argument
  3. have static method named valueof or fromstring accepts single >string argument (see, example, integer.valueof(string))
  4. be list, set or sortedset, t satisfies 2 or 3 above. resulting collection read-only.

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -