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();
    }
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 ( ) ; }
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