JSP and Java: The Complete Guide to Website Development
暫譯: JSP 與 Java:網站開發完全指南

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

Preface.
Acknowledgments.
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.
Index.

商品描述(中文翻譯)

建立動態的、以資料庫驅動的網站,使用 Java 技術—一步一步來!

- 本書是第一本涵蓋建立基於 Java 的網站整個過程的書籍
- 專注於企業網站開發中最強大的開源工具
- JSP、JDBC 和 JavaBeans:實用的 Java 伺服器端解決方案
- 涵蓋 Apache、Tomcat 和 PostgreSQL 的安裝、配置和使用
- 包含使用強大 Java 設計模式的綜合案例研究

現在,有一本從頭到尾的指南,教你如何使用 Java 和開源技術來創建具成本效益和可擴展性的網站。在《JSP 和 Java》中,Art Taylor 提供了現實世界的場景和代碼範例,利用當今關鍵的 Java 和開源技術—包括 JSP、JavaBeans、Apache HTTP 伺服器、Tomcat JSP/Servlet 伺服器和 PostgreSQL 資料庫。

Taylor 首先介紹基於 Java 的網站:它們的優勢、關鍵組件和架構特徵。然後,使用強大的 Java 設計模式,他構建了一個完整的網站,使用 Java 和開源工具—在整個過程中提供了廣泛且詳細的代碼範例。《JSP 和 Java》涵蓋了:

- Apache 網頁伺服器和 Jakarta-Tomcat 應用伺服器:安裝、整合和使用
- 建立 JavaServer Pages 並在 Tomcat 伺服器上部署
- 安裝和配置 Apache 網頁伺服器,全球最受歡迎的 HTTP 伺服器
- 利用 Apache 和 Tomcat 的優勢來最大化應用的可擴展性和穩定性
- 處理存儲在 PostgreSQL 資料庫中的數據—包括詳細的 PostgreSQL 安裝和配置指導
- 建立和部署自定義 JSP 標籤的廣泛代碼範例和討論組應用

《JSP 和 Java》是第一本涵蓋建立基於 Java 的網站所需的所有技術的書籍。如果你準備好實現企業網站開發的全部潛力,這就是你一直在尋找的書籍。

**目錄**

前言。
致謝。
1. 網路的崛起。

介紹。開源解決方案。Java 的歷史。Java 的優勢。網路基礎設施。Java 網站概述。總結。接下來的內容。

2. 創建網路基礎設施:Apache 伺服器。

介紹。網頁伺服器的運作。Apache 背景。配置檔案:httpd.conf。測試 Apache 環境。總結。接下來的內容。

3. 創建網頁伺服器環境:資料庫。

網路基礎設施中的資料庫。背景。運行 PostgreSQL。安裝 PostgreSQL。配置 PostgreSQL。使用 JDBC 驅動程式。總結。接下來的內容。

4. 建立 Java 網站:Tomcat 伺服器。

介紹。處理環境。JSP 環境。Tomcat 的安裝。配置檔案。攔截器定義。總結。接下來的內容。

5. 使各部分協同工作:將 Tomcat 伺服器與 Apache 整合。

介紹。網頁應用。配置 Apache 與 Tomcat/Jakarta 通信。整合所有部分。測試 Apache 與 Tomcat 的連結。建議。定位資源的類別檔案。總結。接下來的內容。

6. Java Server Pages。

介紹。Java Server Pages 的原因。Java Server Pages 開發。JSP 的運作方式。JSP 語法和用法。元素語法。JSP 中的註解。隱式 JSP 對象。指令。JSP 標籤。總結。接下來的內容。

7. 設計 JSP 應用。

介紹。應用組件。設計模式。總結。接下來的內容。

8. JSP 程式設計:基本範例。

介紹。Java 軟體組件:JavaBeans 和 Enterprise JavaBeans。將 JavaBeans 與 Java Server Pages 一起使用。一個 JSP/JavaBeans 範例。JSP 範例:日曆 JavaBean。JavaBeans 與自定義標籤庫的比較。JSP 日曆:JavaBean 代碼。在 JSP 中使用自定義標籤。使用自定義標籤庫:JSP 日曆工具。JavaBeans 或自定義標籤庫:使用提示。總結。接下來的內容。

9. JSP 實踐:討論組系統。

介紹。討論組系統:應用描述。消息系統的應用流程。消息系統的技術描述。總結。接下來的內容。

10. JSP 開發:JavaBeans 程式設計。

介紹。討論組系統的組織。消息系統的應用流程。其餘的故事:JSP 和 JavaBeans 代碼解釋。使用 JSP 建立動態 HTML 表格:已發佈消息頁面。建立動態表格。使用 JSP 進行輸入:消息更新頁面。總結。接下來的內容。

11. 使用 JavaBeans 的資料庫訪問。

介紹。數據訪問對象描述。簡單 DAO:CategoryDAO。資料庫工具類:DBUtil。複雜 DAO:Knowledge_baseDAO。總結。接下來的內容。

12. 將所有內容整合在一起:完成的應用。

介紹。目標。使用多個伺服器的優勢。Apache 和 Tomcat 整合。使用 Apache 提供登錄身份驗證服務。與 PostgreSQL 資料庫整合。在 Tomcat 中部署討論組應用。使用 ant 與 Tomcat 應用。使用 Tomcat 的自動部署。總結。

附錄 A:Tomcat 4.0 伺服器。

介紹。Tomcat 4.0 架構。Tomcat 4.0 設計目標。Tomcat 4.0 架構組件。Tomcat 4.0 組件和可配置屬性。Tomcat 4.0 配置組件。Catalina 連接器。

附錄 B:Enterprise JavaBeans 架構。

定義 Enterprise JavaBeans。EJB 架構。EJB 實現。EJB 與事務。開發 EJB。客戶端訪問。EJB 代碼範例。何時使用 EJB。過度工程化的 EJB。

附錄 C:JDBC API。

JDBC 應用程式編程介面。PreparedStatement 類。將 SQL 數據類型映射到 Java。事務。

附錄 D:代碼清單:Cal.java 和 TagCal.java。

Cal.java。TagCal.java。

附錄 E:代碼清單:KnowledgeBaseFacade.java。附錄 F:Knowledge_baseDAO.java。索引。