@SuppressWarnings("unchecked") @ResponseBody @RequestMapping(value = "/order/updateAdditionalInstructions.ajax", method = RequestMethod.POST) public ResponseEntity<byte[]> updateAdditionalInstructions( @RequestParam(value = "orderId") String orderId, @RequestParam(value = "additionalInstructions") String additionalInstructions) throws Exception { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Updating additional instructions for orderId: " + orderId); } Map<String, Object> model = new HashMap<String, Object>(); try { Order order = orderRepository.findByOrderId(orderId); order.setAdditionalInstructions(additionalInstructions); order = orderRepository.saveOrder(order); model.put("success", true); model.put("order", order); } catch (Exception ex) { LOGGER.error("", ex); model.put("success", false); model.put("message", ex.getMessage()); } return buildOrderResponse(model); }