/** * Processes delete contact ajax request. * * @param id The id of the deleted contact. * @return The feedback message. * @throws NotFoundException if no contact is found with the given id. */ @RequestMapping(value = "/contact/{id}", method = RequestMethod.DELETE) @ResponseBody public String deleteContact(@PathVariable("id") Long id) throws NotFoundException { LOGGER.debug("Deleting contact with id: {}", id); Contact deleted = service.deleteById(id); LOGGER.debug("Deleted contact: {}", deleted); return getMessage( FEEDBACK_MESSAGE_KEY_CONTACT_DELETED, deleted.getFirstName(), deleted.getLastName()); }