code: public static void returnStatusResponse(HttpServletResponse response, int status, String message) {
  		if (response == null) {
  			return;
  		}
  		PrintWriter out = null;
  		try {
  			response.setStatus(status);
  			response.setContentType(MediaType.APPLICATION_JSON);
  			out = response.getWriter();
  			ParaObjectUtils.getJsonWriter().writeValue(out, getStatusResponse(Response.Status.
  					fromStatusCode(status), message).getEntity());
  		} catch (Exception ex) {
  			logger.error(null, ex);
  		} finally {
  			if (out != null) {
  				out.close();
  			}
  		}
  	}
docs: A generic JSON response handler. Returns a message and response code.
  @param response the response to write to
  @param status status code
  @param message error message