It may be bit silly question, but I am confuse if it is possible to receive the JSON Objects in the @FormParam in the POST method under RESTful webservice
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/fetch/")
public List<MyObject> getCandidate(@FormParam("CodeList")
List<String> codeList)
{
List<MyObject> myobjects = null;
try {
//some code
} catch (Exception e) {
//some exception if occur
}
return myobjects;
}
And what if I want to get the userdefine object in the form param.
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/fetch/")
public List<MyObject> getCandidate(@FormParam("CodeList")
List<MyObject> formMyObjectList)
{
List<MyObject> myobjects = null;
try {
//some code
} catch (Exception e) {
//some exception if occur
}
return myobjects;
}
Thanks in advance.