<%! String stringA = null; %> <%! String stringB = null; %> <% if (request.getParameter("stringA")==null) { // display form %>
Please enter the two strings for comparison:

First String:
Second String:

<% } else { // The parameters exist so do the comparison stringA = request.getParameter("stringA"); stringB = request.getParameter("stringB"); if (stringA.equals(stringB)) out.println("
The two strings ARE identical!!"); else out.println("
The two strings ARE NOT identical!!"); } %>