@POST public Response doDeed( @FormParam("altruist") String altruist, @FormParam("recipient") String recipient) { Deed deed = goodStuff.doGoodDeed(altruist, recipient); try { return Response.created(new URI("http://localhost:8080/deed/" + deed.getId())).build(); } catch (URISyntaxException ex) { return Response.serverError().build(); } }