1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application- P1 doc

50 465 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 10,97 MB

Nội dung

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. XML, XSLT, Java  , and JSP  : A Case Study in Developing a Web Application Contents At a Glance 1 Introduction and Requirements 2 An Environment for Java Software Development 3 Java Servlets and JavaServer Pages: Jakarta Tomcat 4 XML and XSLT: Xerces and Xalan 5 bonForum Chat Application: Use and Design 6 bonForum Chat Application: Implementation 7 JavaServer Pages:The Browseable User Interface 8 Java Servlet and Java Bean: BonForumEngine and BonForumStore 9 Java Applet Plugged In: BonForumRobot 10 JSP Taglib:The bonForum Custom Tags 11 XML Data Storage Class: ForestHashtable 12 Online Information Sources A CDROM Contents B Some Copyrights and Licenses C Source Code for bonForum Web Application D Sun Microsystems, Inc. Binary Code License Agreement 00 1089-9 FM 6/26/01 8:20 AM Page i Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 00 1089-9 FM 6/26/01 8:20 AM Page ii Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. XML, XSLT, Java  , and JSP  : A Case Study in Developing a Web Application 201 West 103rd Street, Indianapolis, Indiana 46290 An Imprint of Pearson Education Boston • Indianapolis • London • Munich • New York • San Francisco Westy Rockwell www.newriders.com 00 1089-9 FM 6/26/01 8:20 AM Page iii Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Publisher David Dwyer Associate Publisher Al Valvano Executive Editor Stephanie Wall Managing Editor Gina Brown Product Marketing Manager Stephanie Layton Publicity Manager Susan Nixon Software Development Specialist Jay Payne Project Editor Elise Walter Copy Editor Krista Hansing Indexer Larry Sweazy Manufacturing Coordinator Jim Conway Book Designer Louisa Klucznik Cover Designer Aren Howell Proofreader Jeannie Smith Composition Gina Rexrode XML, XSLT, Java  , and JSP  : A Case Study in Developing a Web Application Translation from the German language edition of: XML, XSLT, Java, and JSP by Westy Rockwell  2000 Galileo Press GmbH Bonn, Germany FIRST EDITION: July 2001 All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying or recording, or by any information storage and retrieval system, without written permission from the publisher, except for the inclusion of brief quotations in a review. International Standard Book Number: 0-7357-1089-9 Library of Congress Catalog Card Number: 00-110885 05 04 03 02 01 7 6 5 4 3 2 1 Interpretation of the printing code:The rightmost double- digit number is the year of the book’s printing; the right- most single-digit number is the number of the book’s printing. For example, the printing code 01-1 shows that the first printing of the book occurred in 2001. Composed in Bembo and MCPdigital by New Riders Publishing Printed in the United States of America Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capital- ized. New Riders Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Java and JavaServer Pages (JSP) are registered trade- marks of Sun Microsystems, Inc. Warning and Disclaimer This book is designed to provide information about XML, XSLT, Java, and JSP. Every effort has been made to make this book as complete and as accurate as possible, but no war- ranty or fitness is implied. The information is provided on an as-is basis.The authors and New Riders Publishing shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the discs or programs that may accompany it. 00 1089-9 FM 6/26/01 8:20 AM Page iv Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ❖ THIS BOOK IS DEDICATED TO MEMORIES OF YOU, DON ROCKWELL, SR. YOU GAVE SO MUCH TO ME! DID I EVER SAY ENOUGH, SOMEHOW, FOR YOU TO KNOW HOW MUCH I LOVE YOU? WITHOUT YOUR LOVE AND KIND GENEROSITY, I WOULD NOT FEEL HALF SO FORTUNATE TO BE ALIVE TODAY. BESIDES THAT, YOU TAUGHT ME TO ENJOY THIS LIFE, SWIM IN THE BLUE OCEANS, AND DIVE DOWN SO DEEPLY. I WOULD MISS YOU FOREVER, IF I WERE NOT SO SURE THAT YOU ARE HERE. THANK YOU! W. R . ❖ 00 1089-9 FM 6/26/01 8:20 AM Page v Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. T ABLE OF C ONTENTS 1 Introduction and Requirements 1 1.1 The Goal of This Book 1 1.2 Why Use This Book? 2 1.3 How to Use This Book 4 1.4 Some Choices Facing Web Application Developers 6 1.5 Development Choices Made for This Book 8 1.6 A Note About Platform Independence 14 2 An Environment for Java Software Development 15 2.1 Java 2 Platform, Standard Edition 15 2.2 Compiling Java Programs 19 2.3 Running Java Programs 30 2.4 Debugging Java Programs 32 2.5 Other Features of ElixirIDE 33 3 Java Servlets and JavaServer Pages: Jakarta Tomcat 35 3.1 Apache Software Foundation 35 3.2 Jakarta Tomcat 36 3.3 Installing Tomcat 37 3.4 Running Tomcat 39 00 1089-9 FM 6/26/01 8:21 AM Page vi Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 3.5 Tomcat Examples of Servlets and JSPs 49 3.6 Adding Your Tomcat Web Application 49 3.7 Java Servlets and JSPs 53 3.8 The ServletConfig and ServletContext Classes 57 3.9 Web Application Scopes 58 4 XML and XSLT: Xerces and Xalan 61 4.1 Apache XML Project 61 4.2 Installing Xerces 62 4.3 Xerces Parses XML 64 4.4 SAX Sees XML as Events 67 4.5 Installing Xalan 67 4.6 Xalan Transforms XML Using XSLT 70 4.7 Using Beanshell with Xalan 72 4.8 Using Xalan from the Command Line 73 4.9 Zvon XSL Tutorial 73 4.10 Xerces and Xalan versus XT and XP 73 4.11 JSP and XML Synergy 74 5 bonForum Chat Application: Use and Design 77 5.1 Installing and Running bonForum 77 5.2 Changing the bonForum Web Application 83 5.3 Using XML to Design Web Applications 86 5.4 XML Data Flows in Web Applications 98 vii Contents 00 1089-9 FM 6/26/01 8:21 AM Page vii Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 6 bonForum Chat Application: Implementation 103 6.1 Building the bonForum Web Chat 103 6.2 Displaying and Selecting Chat Subjects 138 6.3 Displaying Chat Messages 140 6.4 Finding the Chat Element 146 6.5 Displaying and Selecting Chats 148 6.6 Displaying Guests in Chat 150 6.7 Outputting the bonForum Data as XML 150 6.8 Future of bonForum Project 151 7 JavaServer Pages: The Browseable User Interface 155 7.1 JSP-Based Web Applications 155 7.2 Viewing bonForum from Its JSP Documents 163 7.3 Further Discussion About the JSP in bonForum 187 8 Java Servlet and Java Bean: BonForumEngine and BonForumStore 189 8.1 The BonForumEngine Servlet 189 8.2 The BonForumStore Class 262 9 Java Applet Plugged In: BonForumRobot 285 9.1 Hands-on with Java Applets 285 9.2 XSLTProcessor Applet 290 9.3 BonForumRobot 290 viii Contents 00 1089-9 FM 6/26/01 8:21 AM Page viii Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 10 JSP Taglib: The bonForum Custom Tags 303 10.1 Java Servlets, JSP, and Tag Libraries 303 10.2 The bonForum Tag Library 316 10.3 The OutputDebugInfoTag Class 324 10.4 The OutputPathNamesTag Class 331 10.5 The OutputChatMessagesTag Class 340 10.6 XSLT and the TransformTag Class 352 10.7 Displaying the Available Chats 371 10.8 Displaying the Available bonForums 376 10.9 Displaying the Guests in a Chat 379 11 XML Data Storage Class: ForestHashtable 385 11.1 Overview of bonForum Data Storage 385 11.2 The NodeKey Class 387 11.3 The BonNode Class 388 11.4 ForestHashtable Maps Data Trees 390 11.5 Caching Keys for Fast Node Access 398 11.6 Adding ForestHashtable Nodes 404 11.7 Deleting ForestHashtable Nodes 411 11.8 Editing ForestHashtable Nodes 414 11.9 Getting ForestHashtable as XML 416 ix Contents 00 1089-9 FM 6/26/01 8:21 AM Page ix Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... process for XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application As the book was being written, these dedicated professionals reviewed all the material for technical content, organization, and flow.Their feedback was critical to ensuring that XML, XSLT, Java, and JSP: A Case Study in Developing a Web Application fits our reader’s need for the highest-quality technical information Brad Irby... side when developing Web applications One of these advantages is especially compelling to those of us who have supported widely distributed software that we had to install and configure on every last client machine! A Web application that can change, adapt, and evolve by changing only the software on a few server machines is far easier to deploy, maintain, and support than is a Web application made up... software tools and libraries that we selected to illustrate a large subject: developing Web applications powered by XML, XSLT, Java servlets, Java applets, and JavaServer Pages 1.1 The Goal of This Book While writing this book, we have assumed that you, its reader, are a software developer with some Java experience and that you want to build Web applications based on XML, XSLT, Java servlets, Java applets,... http://www.allaire.com/Products/JRun/ Many Web- application framework products also understand servlets and JSP Prominent among these are Netscape Application Server and iPlanet, Oracle Application Server, BEA Weblogic, and Resin 1.6 A Note About Platform Independence If you want to base your Web applications on the Java language, you probably know that one of its main advantages is platform independence.You... developer who wants to create server-based Web applications, you have a wide choice of languages and tools to use Some important languages are Java, C++,Visual Basic, Perl, and Python Of course, HTML (especially now as XHTML) is crucial for controlling browser content XML and its related languages are becoming increasingly important, especially for representing and transforming data ASP, PHP, and Cold Fusion,... XML and Java-based technologies could be applied by the reader That is when the fun started I designed and implemented a Web chat application called bonForum It is based on XML and XSLT, Java servlets and applets, and JSP It presented me with many of the most challenging tasks of Web application design As a very popular and timely type of Web application, I trust that it will interest the reader As an... XSLT: Xerces and Xalan,” introduces Xerces, a DOM and a SAX parser, and Xalan, an XSLT and XPATH processor Chapter 5, “BonForum Chat Application: Use and Design,” introduces you to bonForum, the Web chat application that will be the major subject of the rest of the book It was designed as a tool to explore each of the subjects of this book, XML, XSLT, Java Servlets, Java Applets and JavaServer Pages, while... the software distribution problems.The Java plug -in provides a way to run Java applets transparently on differing Web browsers According to James Gosling, the creator of Java, the closer integration of the plug -in and browser technology is an important goal for Java.That will help dispel criticisms of those who find the delays of downloading the Java plug -in and Java applets time-consuming and disruptive... project Chapter 2, “An Environment for Java Software Development,” teaches you how to set up an inexpensive Java development environment It shows you how to compile, debug and run the Web application example project Chapter 3, “Java Servlets and JavaServer Pages: Jakarta Tomcat,” introduces Tomcat, which is an HTTP server and a container for Java Servlets and JavaServer Pages Chapter 4, “XML and XSLT:... especially with so many other resources available? The best answer is that this book is a hands-on “laboratory manual.” It is meant to complement, not replace, other books on XML, XSLT, Java servlets and applets, and JSP Like any laboratory manual, this book assumes at least a basic understanding of the subjects of its experiments.This book uses original material for learning its topics, within a context . and a container for Java Servlets and JavaServer Pages. Chapter 4,“XML and XSLT: Xerces and Xalan,” introduces Xerces, a DOM and a SAX parser, and Xalan,. the material for technical content, organization, and flow.Their feedback was critical to ensuring that XML, XSLT, Java, and JSP: A Case Study in Developing

Ngày đăng: 14/12/2013, 22:15

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN