@POST @Path("/add") public Response addShirt( @BeanParam ShirtFormData shirtFormData, @Context SecurityContext securityContext) throws Exception { final Shirt shirt = new Shirt(shirtFormData.getName()); shirt.setCount(shirtFormData.getCount()); shirt.setCut(shirtFormData.getCut()); shirt.setSize(shirtFormData.getSize()); shirtDatastore.add(shirt); return Response.status(Response.Status.FOUND).location(INDEX_URI).build(); }