Vote count: 0 Hello all i am using rest and mysql as my db. Below is my rest get code for getting allbooks(Resource) @GET @Produces(MediaType.APPLICATION_JSON) public Response getBooks(@QueryParam("format") String format) { retu Response.status(Status.OK).entity((new GenericEntity(bookService.getAllBooks()) { })).header(HttpHeaders.CONTENT_TYPE, "XML".equalsIgnoreCase(format) ? MediaType.APPLICATION_XML + ";charset=UTF-8" : MediaType.APPLICATION_JSON + ";charset=UTF-8").build(); } Below is my service public List getAllBooks() { retu new ArrayList(booksDao.getAllBooks()); /* retu new ArrayList(books.values()); */ } Below is my DB public List getAllBooks() { retu jdbcTemplate.query("select * f...
ادامه مطلب