JSP and Java: The Complete Guide to Website Development

Art Taylor



Build dynamic, database-driven Web sites with Java technologies—step by step!

  • The first book to cover the entire process of building Java-based Web sites
  • Focuses on the most powerful open source tools for enterprise Web development
  • JSP, JDBC, and JavaBeans: practical Java server-side solutions
  • Covers Apache, Tomcat, and PostgreSQL installation, configuration, and use
  • Includes comprehensive case study using powerful Java design patterns

Now, there's a start-to-finish guide to using Java and open source technologies to create cost-effective, scalable Web sites. In JSP and Java, Art Taylor presents real-world scenarios and code examples that leverage today's key Java and open source technologies—including JSP, JavaBeans, the Apache HTTP server, Tomcat JSP/servlet server, and the PostgreSQL database.

Taylor begins by introducing Java-based Web sites: their advantages, key components, and architectural attributes. Then, using powerful Java design patterns, he constructs a complete Web site using Java and open source tools—presenting extensive, carefully documented code examples throughout. JSP and Java covers:

  • Apache Web server and the Jakarta-Tomcat application server: installation, integration, and use
  • Building JavaServer Pages and deploying them on the Tomcat server
  • Installing and configuring the Apache Web server, the world's most popular HTTP server
  • Leveraging the strengths of Apache and Tomcat to maximize application scalability and stability
  • Working with data stored in PostgreSQL databases—including detailed PostgreSQL installation and configuration guidance
  • Extensive code examples for building and deploying custom JSP tags and a discussion group application

JSP and Java is the first book to cover all the technologies needed to build Java-based Web sites. If you're ready to achieve the full promise of enterprise Web development, this is the book you've been searching for.

Table of Contents

1. The Web Takes Over.

Introduction. Open Source Solutions. History of Java. Benefits of Java. Web Infrastructure. Java Web Site Overview. Summary. Coming Up Next.

2. Creating the Web Infrastructure: The Apache Server.

Introduction. The Operation of the Web Server. Background on Apache. Configuration File: httpd.conf. Testing the Apache Environment. Summary. Coming Up Next.

3. Creating the Web Server Environment: The Database.

Database in the Web Infrastructure. Background. Running PostgreSQL. Installing PostgreSQL. Configuring PostgreSQL. Using the JDBC Driver. Summary. Coming Up Next.

4. Building the Java Web Site: The Tomcat Server.

Introduction. Processing Environment. JSP Environment. Installation of Tomcat. Configuration Files. Interceptor Definitions. Summary. Coming Up Next.

5. Making the Pieces Work: Integrating the Tomcat Server with Apache.

Introduction. Web Application. Configuring Apache to Communicate with Tomcat/Jakarta. Pulling It All Together. Testing the Link of Apache to Tomcat. Recommendations. Locating Class Files for Resources. Summary. Coming Up Next.

6. Java Server Pages.

Introduction. Reason for Java Server Pages. Java Server Pages Development. How JSP Works. JSP Syntax and Usage. Element Syntax. Comments in JSP. Implicit JSP Objects. Directives. JSP Tags. Summary. Coming Up Next.

7. Designing JSP Applications.

Introduction. Application Components. Design Patterns. Summary. Coming Up Next.

8. JSP Programming: A Basic Example.

Introduction. Java Software Components: JavaBeans and Enterprise JavaBeans. Using JavaBeans with Java Server Pages. A JSP/JavaBeans Example. JSP Example: The Calendar JavaBean. JavaBeans versus Custom Tag Libraries. JSP Calendar: JavaBean Code. Using Custom Tags in JSP. Using a Custom Tag Library: The JSP Calendar Utility. JavaBeans or Custom Tag Libraries: Tips on Use. Summary. Coming Up Next.

9. JSP in Practice: A Discussion Group System.

Introduction. Discussion Group System: Application Description. Application Flow for the Message System. Technical Description of the Message System. Summary. Coming Up Next.

10. JSP Development: JavaBeans Programming.

Introduction. Organization of the Discussion Group System. Message System Application Flow. The Rest of the Story: JSP and JavaBeans Code Explained. Building Dynamic HTML Tables with JSP: The Posted Messages Page. Building the Dynamic Table. Performing Input with JSP: The Message Update Page. Summary. Coming Up Next.

11. Database Access with JavaBeans.

Introduction. Data Access Objects Description. Simple DAO: CategoryDAO. Database Utility Class: DBUtil. Complex DAO: Knowledge_baseDAO. Summary. Coming Up Next.

12. Bringing It All Together: the Completed Application.

Introduction. The Goal. Advantages of Using Multiple Servers. Apache and Tomcat Integration. Using Apache to Provide Login Authentication Services. Integrating with the PostgreSQL Database. Deploying the Discussion Group Application in Tomcat. Using ant with Tomcat Applications. Using Auto Deploy with Tomcat. Summary.

Appendix A: The Tomcat 4.0 Server.

Introduction. Tomcat 4.0 Architecture. Tomcat 4.0 Design Goals. Tomcat 4.0 Architectural Components. Tomcat 4.0 Components and Configurable Attributes. Tomcat 4.0 Configuring Components. Catalina Connectors.

Appendix B: Enterprise JavaBeans Architecture.

Enterprise JavaBeans Defined. EJB Architecture. EJB Implementation. EJBs and Transactions. Developing EJBs. Client Access. EJB Code Sample. When to Use EJBs. Over-Engineering with EJBs.

Appendix C: JDBC API.

JDBC Application Programmer Interface. PreparedStatement Class. Mapping SQL Data Types into Java. Transactions.

Appendix D: Code Listings: Cal.java and TagCal.java.

Cal.java. TagCal.java.

Appendix E: Code Listing: KnowledgeBaseFacade.java.
Appendix F: Knowledge_baseDAO.java.