how to pass arraylist in return ok function of play framework

by kunda   Last Updated December 27, 2017 11:05 AM

When i am hitting the rest url in postman I am not getting the response but in debugger it is showing that list policyList has 5 items.

List policyList = repository.getPolicyName(field);//fetches objects list(each object has just one string int it) return ok(Message.messageFromObject(Consts.SUCCESS,new Gson().toJson(policyList)));

Neither converting policyList of objects to json is working or by directly passing like below is working. return ok(Message.messageFromObject(Consts.SUCCESS,policyList));

Can you suggest what to pass in return so that I can get a valid response. I am using play framework.



Related Questions


Is the Play! Framework MVC or 3-tier?

Updated September 05, 2017 16:05 PM


Promise Akka Play Java Sequence

Updated July 21, 2015 13:02 PM

Migrating a Grails application to Scala Play/Spray

Updated February 27, 2016 01:02 AM