The HTTP DELETE method deletes the resource pointed by the URI. The @javax.ws.rs.DELETE annotation designates the method of a resource class to respond to the HTTP DELETE requests.
The following code snippet shows how you can use the @DELETE annotation to designate the removeDepartment() method to respond to the HTTP DELETE request. The department ID is passed as the path variable in this example:
@DELETE @Path("{id}") public void removeDepartment(@PathParam("id") Short id) { //remove department entity from data store removeDepartmentEntity(id); }