Ideal for Tomcat administrators and those who wish to configure Tomcat, this succinct text describes configuration files, as well as administration features like security, auto-deployment, remote deployment, and datasources.
Java was initially released in the mid-1990s as a way to liven up static Web pages. It was platform independent and allowed developers to execute their programs, called applets, in the user’s browser. An incredible amount of hype surrounded applets: that they would make the Web more exciting and interactive, that they would change the way people bought computers, and that they would reduce all the various operating systems into mere platforms for Web browsers.
Applets never really caught on; in fact, other technologies, such as Macromedia Flash, became more popular ways of creating interactive Web sites. However, Java isn’t just for writing applets: you can also use it to create stand-alone platform-independent applications.
The main contribution of Java to the Web is servlets, which are another alternative technology to CGI. Just as CGI and its other alternatives aren’t stand-alone programs (because they require a Web server), servlets require a servlet container to load servlets into memory. The servlet container then receives HTTP requests from browsers and passes them to servlets that generate the response. The servlet container can also integrate with other Web servers to use their more efficient static file abilities while continuing to produce the dynamic content. You’ll find an example of this in Chapter 9 when you integrate Tomcat with Apache and IIS.
Unfortunately, although servlets are an improvement over CGI, especially with respect to performance and server load, they too have a drawback. They’re primarily suitable for processing logic. For the creation of content (that is, HTML), they’re less usable. First, hard-coding textual output, including HTML tags, in code makes the application less maintainable. This is because if text in the HTML must be changed, the servlet must be recompiled.
Second, this approach requires the HTML designer to understand enough about Java to avoid breaking the servlet. More likely, however, the programmer of the application must take the HTML from the designer and then embed it into the application: an error-prone task if ever there was one.
To solve this problem, Sun Microsystems created the JavaServer Pages (JSP) technology.