@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
NewRequestReimbursementType request = mapper.readValue(req.getInputStream(), NewRequestReimbursementType.class);
ReimbursementType createdReimbursementType = reimbursementTypeService.createReimbursementType(request);
resp.setContentType("application/json");
resp.setStatus(200);
resp.getWriter().write(mapper.writeValueAsString(createdReimbursementType.getType_id()));
resp.getWriter().write(mapper.writeValueAsString(createdReimbursementType.getType_id()));
} catch (InvalidSQLException e) {
resp.setStatus(404);
resp.getWriter().write(mapper.writeValueAsString(e.getMessage()));
} catch (ResourceConflictException e) {
resp.setStatus(409);
}
}
- Projects: Links click to visit.