November 2000
Intermediate to advanced
1440 pages
36h 18m
English
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
aWriter.println("<HTML><HEAD><TITLE>Some title</TITLE></HEAD>");
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, ...
Read now
Unlock full access