As you've seen, servlets are well suited to function as form processors. You write an HTML form, submit it using GET or POST, and process the results in the servlet. Alas, all those lines like
can get tedious. Sun has mixed HTML and Java in the same file to combat this problem. The solution is called Java Server Pages, or JSP. Listing 41.5 shows a small JSP file.
<HTML> <HEAD><TITLE>Demo JSP</TITLE></HEAD> <BODY> <%@ page contentType="text/html" %> <% out.println("Hello, world! from a JavaServer Page"); %> </BODY> </HTML>
To install and run a JSP in Jakarta Tomcat, ...