@RequestMapping(value = "/removeDocumentContentType", method = RequestMethod.GET) public @ResponseBody void removeDocumentContentType( @RequestParam(value = "nID") Long nID, HttpServletResponse response) { try { documentContentTypeDao.removeDocumentContentType(nID); } catch (RuntimeException e) { response.setStatus(403); response.setHeader("Reason", e.getMessage()); } }
@RequestMapping(value = "/setDocumentContentType", method = RequestMethod.GET) public @ResponseBody ResponseEntity<DocumentContentType> setDocumentContentType( @RequestParam(value = "nID") Long nID, @RequestParam(value = "sName") String sName) { ResponseEntity<DocumentContentType> result; try { DocumentContentType documentType = documentContentTypeDao.setDocumentContentType(nID, sName); result = JsonRestUtils.toJsonResponse(documentType); } catch (RuntimeException e) { result = toJsonErrorResponse(403, e.getMessage()); } return result; }