// Get all authors @Path("/authors/{authorid}.json") @GET @Produces(MediaType.APPLICATION_JSON) public Author author(@PathParam("authorid") Integer id) { return _authorDao.getAuthor(id); }
// Get individual author @Path("/authors.json") @GET @Produces(MediaType.APPLICATION_JSON) public Collection<Author> authors() { return _authorDao.getAllAuthors(); }
public AuthorResource(@Context Application app) throws Exception { _authorDao = (AuthorDao) app.getProperties().get("authorDao"); logger.info("Using AuthorDao implementation " + _authorDao.getClass().getSimpleName()); }