How can I return a list of Question objects in XML or JSON?
@Path("all")
@GET
public List<Question> getAllQuestions() {
return questionDAO.getAllQuestions();
}
I get this exception:
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException:
com.sun.jersey.api.MessageException: A message body writer for Java
class java.util.Vector, and Java type
java.util.List, and MIME media
type application/octet-stream was not found
Try:
If your goal is to return a list of item you can use:
Edit
Added original answer above