//Main service
@Path("/test")
public class ReturnMultiple {
public static ArrayList<String> al = new ArrayList<String>();
@POST
@Path("/new/{name}")
@Produces(MediaType.TEXT_PLAIN)
public ArrayList<String> display(@PathParam("name") String name) {
al.clear();
Todo td = new Todo();
td.setName(name);
al.add(td.getName());
return al;
}
}
// This is Pojo
public class Todo {
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Whenever I hit the service I get this error as Below
A message body writer for Java class java.util.ArrayList, and Java type java.util.ArrayList, and MIME media type text/plain was not found
/test/new/namearrive at the same time?ArrayList, that's the issue