Step 9. Return the Results to the Client

The final step constructs and sends an HTML page, which contains the results of the service call, back to the client through the HttpResponse output stream. The uppercase result is retrieved from the ServletResult object using the result.getValue() method.

The following is a simple example of passing this data back as HTML that the browser can display:

out.println("<p><center><font size=+1><b>"+
           result.getValue("STRING", "")+
           "</b></font></center><p><hr
           width=80%>");

The output stream produces a page similar to the one shown in the following figure:

Figure -2 Output Stream Results Example

Output Stream Results Example Diagram