Example #1
0
 @GET
 @Path("{id}")
 @Produces("application/xml")
 public T getByIdAsXml(@PathParam("id") int id) {
   T one = (T) dao.findById(id);
   return one;
 }
Example #2
0
 @GET
 @Produces("application/xml")
 public String getAllAsXml() {
   List<T> all = dao.findAll();
   EntityList<T> list = new EntityList<T>();
   list.setItems(all);
   String s = marshall(entityClass, list);
   return s;
 }