コード例 #1
0
 @GET
 @Path("/{id}/delete")
 public Response deleteShirt(@PathParam("id") String id, @Context SecurityContext securityContext)
     throws Exception {
   final Shirt toDelete = shirtDatastore.get(id);
   return Response.ok(new DeletePage(toDelete, securityContext, userService).build()).build();
 }
コード例 #2
0
 @GET
 @Path("/{id}/edit")
 public Response editShirt(@PathParam("id") String id, @Context SecurityContext securityContext)
     throws Exception {
   final Shirt shirt = shirtDatastore.get(id);
   if (shirt == null) {
     throw new NotFoundException("No shirt found for ID: " + id);
   }
   return Response.ok(new EditPage(shirt, securityContext, userService).build()).build();
 }