try { //Get the TextArea from the JSP page String TextArea1 = request.getParameter("TextArea1"); //Initialize WS operation arguments java.lang.String bodyText = TextArea1; //Process result com.cdyne.ws.DocumentSummary doc = checkTextBodyV2(bodyText); String allcontent = doc.getBody(); //From the retrieved document summary, //identify the number of wrongly spelled words: int no_of_mistakes = doc.getMisspelledWordCount(); //From the retrieved document summary, //identify the array of wrongly spelled words: List allwrongwords = doc.getMisspelledWord(); out.println(""); out.println(""); //Display the report's name as a title in the browser's titlebar: out.println("Spell Checker Report"); out.println(""); out.println(""); //Display the report's name as a header within the body of the report: out.println("

Reporte de Sintaxis Gramatical

"); //Display all the content (correct as well as incorrectly spelled) between quotation marks: out.println("
Su texto: \"" + allcontent + "\"" + "

"); //For every array of wrong words (one array per wrong word), //identify the wrong word, the number of suggestions, and //the array of suggestions. Then display the wrong word and the number of suggestions and //then, for the array of suggestions belonging to the current wrong word, display each //suggestion: for (int i = 0; i < allwrongwords.size(); i++) { String onewrongword = ((Words) allwrongwords.get(i)).getWord(); int onewordsuggestioncount = ((Words) allwrongwords.get(i)).getSuggestionCount(); List allsuggestions = ((Words) allwrongwords.get(i)).getSuggestions(); out.println("


Palabra errada: " + onewrongword + ""); out.println("

" + onewordsuggestioncount + " Segerencias:
"); for (int k = 0; k < allsuggestions.size(); k++) { String onesuggestion = (String) allsuggestions.get(k); out.println(onesuggestion); } } //Display a line after each array of wrong words: out.println("


"); //Summarize by providing the number of errors and display them: out.println("Resumen: " + no_of_mistakes + " errores ("); for (int i = 0; i < allwrongwords.size(); i++) { String onewrongword = ((Words) allwrongwords.get(i)).getWord(); out.println(onewrongword); } out.println(")."); out.println(""); out.println(""); out.println(""); } catch (Exception ex) { out.println("exception" + ex); } finally { out.close(); }