MultiMap clientMap = routingContext.request().formAttributes();
Client Map Value :
firstName: Raj lastName: ku address1: bang city: bhiwani state: Alabama zip: 22222 country: US shippingMethod: 1a
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/0043a5da-7fed-4115-b3f5-2cc16199b75e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Multimap is an Iterable of Map.Entry<String, String>. So it should be easy to loop over those entries and build a JsonObject instance.
2016-11-08 8:00 GMT+01:00 Yogesh Kumar <yogesh...@gmail.com>:
Hi All,
I am passing data as form (ie key and value pair),then getting this data as a MultiMap object.
MultiMap clientMap = routingContext.request().formAttributes();Client Map Value :firstName: Raj lastName: ku address1: bang city: bhiwani state: Alabama zip: 22222 country: US shippingMethod: 1aRequirement : need to convert this map (clientMap) into json format like given below.{"firstName":"RAVI","lastName":"Mandli","address1":"Hno22","Company":"Sapient","address2":"CityRoad","city":"Surat","state":"Gujrat","zip":"127040","country":"India","saveToAccount":"true","shippingMethod":"1a"}tried too much way but not getting any solutions. Please give appropriate solutions.Thanks ,Yogesh Kumar
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Multimap is an Iterable of Map.Entry<String, String>. So it should be easy to loop over those entries and build a JsonObject instance.
2016-11-08 8:00 GMT+01:00 Yogesh Kumar <yogesh...@gmail.com>:
Hi All,
I am passing data as form (ie key and value pair),then getting this data as a MultiMap object.
MultiMap clientMap = routingContext.request().formAttributes();Client Map Value :firstName: Raj lastName: ku address1: bang city: bhiwani state: Alabama zip: 22222 country: US shippingMethod: 1aRequirement : need to convert this map (clientMap) into json format like given below.{"firstName":"RAVI","lastName":"Mandli","address1":"Hno22","Company":"Sapient","address2":"CityRoad","city":"Surat","state":"Gujrat","zip":"127040","country":"India","saveToAccount":"true","shippingMethod":"1a"}tried too much way but not getting any solutions. Please give appropriate solutions.Thanks ,Yogesh Kumar
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
JsonObject metadata = new JsonObject();
for (Map.Entry<String, String> entry : dataMap.entries()) {
metadata.put(entry.getKey(), entry.getValue());
}
done it same way and problem resolved .
Thanks again :)