© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 29.1 Multi-Tier Architecture 29.2 Web Servers 29.3 Apache Tomcat Web Server 29.4 Test-Driving the Bookstore Application 29.5 Wrap-Up Tutorial 29 – Bookstore Application: Web Applications Introducing Apache Tomcat Web Server
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 2 Objectives In this tutorial, you will learn to: –Use the Apache Tomcat Web server to serve Web content to Web browser clients. –Request documents from a Web server. –Execute a Web application that uses Java Server Pages technology.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Multi-Tier Architecture Web applications –Java Server Pages JSP –HTML (HyperText Markup Language) Multi-Tier applications –n-tier applications –Tier Information tier –Data tier, bottom tier Middle tier –Business logic tier Client tier –Top tier
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Multi-Tier Architecture (Cont.) Figure 29.1 Three-tier application model.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Web Servers Web Server URL (Uniform Resource Locator) –Host –Domain Domain name (Web address) –Fully qualified domain name (FQDN) Top-level domain (TLD) –IP (Internet Protocol) address –Domain Name System (DNS) server –DNS Lookup
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server Figure 29.2 Locating the Java Development Kit. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.3 Accepting the Tomcat license agreement. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.4 Accepting Tomcat default installation options. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.5 Choosing the default Tomcat installation directory. Copyright © The Apache Software Foundation ( All rights reserved. Tomcat installation default directory
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.6 Tomcat installation process dialog. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.7 Selecting a Tomcat administrator password. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure 29.8 Completing the Tomcat installation. Copyright © The Apache Software Foundation ( All rights reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Copy the C:\Examples\Tutorial29\ CompletedApplication\bookstore directory to Tomcat’s webapps directory Figure 29.9 Copying the bookstore folder to webapps.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Apache Tomcat Web Server (Cont.) Figure Copying the database JAR files to the Bookstore Web application.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Bookstore Application
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Bookstore Application (Cont.) Figure Tomcat server output window.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Bookstore Application (Cont.) Figure HTML page that displays a form, with a list and a button. HTML page titleLocation of books.jsp pageHTML h1 header elementHTML paragraph elementHTML menu control used to display a list HTML input element with type submit used to display a button
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Bookstore Application (Cont.) Figure Page that displays the selected books information. Address of bookInformation.jsp page When clicked, this link returns users to books.jsp
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Test-Driving the Bookstore Application Figure Deleting the bookstore folder from Tomcats webapps folder. Right click bookstore Select delete