CANNOT Accept Multiple JSON DATA FROM FRONT END

Wei Jing <[email protected]> Thu, 23 May 2013 13:37:57 +0100
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
Hi all,

Hope you are well.

I use backbone.js in Front End to send ajax request to an ERESTController by POST HTTP method.  The controller I use that  can not accept multi payload data in a WORequest.  

Here is the detail:

In my request context I already have those values.

1. when requests encoded asapplication/json,
formValues={model = ("{"title":"444","body":"4444","articleId":"3539"}"); }

2. when the request to be made with aapplication/x-www-form-urlencoded MIME type, as if from an HTML form
 formValues={WOIsmapCoords = ("{"title":"eee","body":"eee","articleId":"3539"}"); }


I can
@QueryParam("articleId") Integer articleId
@QueryParam("title") String title
@QueryParam("body") String body 


But I can use
@QueryParam("model") String model
@QueryParam("WOIsmapCoords") String WOIsmapCoords

or
String a = (String) request().formValueForKey("model");
String a = (String) request().formValueForKey("WOIsmapCoords");


to get Strig "{"title":"eee","body":"eee","articleId":"3539"}"

And request() returns a WORequest.

Do anyone know that if there are any methods to accept multi form or json data from front end in er.rest.routes.jsr311 package? Like @Consumes in Jboss. 

Thank you so much!!

Regards,
Wynne

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc