code: private void sendResponse(final HttpServletResponse res, final CmsSpellcheckingRequest request) throws IOException {
  
          final PrintWriter pw = res.getWriter();
          final JSONObject response = getJsonFormattedSpellcheckResult(request);
          pw.println(response.toString());
          pw.close();
      }
docs: Sends the JSON-formatted spellchecking results to the client.
  
  @param res The HttpServletResponse object.
  @param request The spellchecking request object.
  
  @throws IOException in case writing the response fails