From: Antonio G. <ant...@gm...> - 2010-10-27 14:36:51
|
No, I still have a 404. I've tried /{bookKey}, didn't work, and then I've also tried just a / on the findAllBooks method but with no success : @Stateless @Path("/items") @Dependent public class ItemEJB { @PersistenceContext private EntityManager em; // ====================================== // = Business methods = // ====================================== @GET *@Path("/{bookKey}")* @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Book getBook(@PathParam("bookKey") Long bookKey) { return em.find(Book.class, bookKey); } @GET * @Path("/")* @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public List<Book> findAllBooks() { return em.createNamedQuery("findAllBooks").getResultList(); } ... } 2010/10/27 Ilya Dyoshin <il...@un...> > Change the path to > > @Path("/{bookKey}") > > > Kind regards, > Ilya Dyoshin > > 27 окт. 2010, в 16:17, Antonio Goncalves написал(а): > > @GET > *@Path("{bookKey}")* > @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) > public Book getBook(@PathParam("bookKey") Long bookKey) { > return em.find(Book.class, bookKey); > } > > > -- -- Antonio Goncalves (ant...@gm...) Software architect Web site : www.antoniogoncalves.org Blog: agoncal.wordpress.com Feed: feeds2.feedburner.com/AntonioGoncalves Paris JUG leader : www.parisjug.org LinkedIn: www.linkedin.com/in/agoncal |