www.GetPedia.com *More than 150,000 articles in the search database *Learn how almost everything works IBM WebSphere Application Server - The Complete Reference Ron Ben-Natan Ori Sasson McGraw-Hill/Osborne 2600 Tenth Street Berkeley, California 94710 U.S.A. To arrange bulk purchase discounts for sales promotions, premiums, or fund-raisers, please contact McGraw-Hill/Osborne at the above address. For information on translations or book distributors outside the U.S.A., please see the International Contact Information page immediately following the index of this book. Copyright © 2002 by The McGraw-Hill Companies. All rights reserved. Printed in the United States of America. Except as permitted under the Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of publisher, with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced for publication. 1234567890 DOC DOC 0198765432 Book p/n 0-07-222395-2 and CD p/n 0-07-222396-0 parts of ISBN 0-07-222394-4 Publisher Brandon A. Nordin Vice President & Associate Publisher Scott Rogers Editorial Director Wendy Rinaldi Senior Acquisitions Editor Nany Maragiogilo Project Editors Jenn Tust, Madhu Prasher Acquisitions Coordinator Tim Madrid Technical Editors David Draeger, Tom Gissel Andrew McCright, Keith McGuinnes Copy Editors Emily Rader, Lisa Theobald Proofreaders Cheryl Abel, Nancy McLaughlin Deidre Dolce Indexer Valerie Robbins Page Composition Apollo Publishing Services and Osborne Production Staff Illustrators Michael Mueller, Lyssa Wald Melinda Moore Lytle Series Design Peter F. Hancik This book was composed with Corel VENTURA™ Publisher. Information has been obtained by McGraw-Hill/Osborne from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill/Osborne, or others, McGraw-Hill/Osborne does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. This book is not a product of IBM, and IBM is not responsible for the contents of this book. The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both. AIX®, AFS®, alphaWorks®, AS/400®, CICS®, CICS Connection®, DB2®, DB® Universal Database, e-business (logo), IBM®, MQSeries®, SanFrancisco, SecureWay®, Tivoli®, Tivoli Enterprise Console®, TopPage®, TXSeries, VisualAge®, and WebSphere®. Note: Those trademarks followed by (®) are registered trademarks of IBM in the United States; all others are trademarks of IBM in the United States. Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Microsoft, Windows, and Windows NT are registered trademarks of Microsoft Corporation. Netscape and Netscape Navigator are trademarks of Netscape Communications Corporation. DOMINO GO WEBSERVER is a trademark of Lotus and/or IBM Corporation in the United Kingdom and Malaysia. All other trademarks are the property of their respective owners. Documentation Used by IBM IBM WebSphere Application ServerPlus for Tivoli product documentation IBM WebSphere Application Server Online Documentation Center (Part of the product distribution) Redbooks Java Application Development for CICS, SG24-5275-01 Revealed! Architecting Web Access of CICS, SG24-4566-00 Application Development with VisualAge for Java Enterprise, SG24-5081-00 Web Enabling System/390 Applications Using WebSphere for OS/390, Java, and MQSeries, REDP0027 Web Caching and Filtering with IBM WebSphere Performance Pack, REDP0009 Caching and Filtering to Manage Internet Traffic and Bandwidth Demand, REDP0003 IBM WebSphere Performance Pack: Caching and Filtering with IBM Web Traffic Express, SG24-5859-00 IBM WebSphere Performance Pack: Load Balancing with IBM SecureWay Network Dispatcher, SG24-5858-00 IBM WebSphere Performance Pack: Web Content Management with IBM AFS Enterprise File System, SG24-5857-00 Managing Your Java Software with IBM SecureWay On-Demand Server Release 2.0, SG24-5846-00 Java Thin Client Systems: With VisualAge Generator-In IBM WebSphere Application Server, SG24-5468-00 Developing an e-business Application for the IBM WebSphere Application Server, SG24-5423-00 IBM WebSphere and VisualAge for Java Database Integration with DB2, Oracle, and SQL Server, SG24-5471-00 WebSphere Application Server: Standard and Advanced Editions, SG24-5460-00 Using VisualAge for Java Enterprise Version 2 to Develop CORBA and EJB Applications, SG24-5276-00 IBM WebSphere Performance Pack Usage and Administration, SG24-5233-00 Dedicated to Yael and Rinat. -Ori & Ron Acknowledgments We would like to thank the IBM review team who devoted their time and attention to raising the quality of the book. Their thoroughness, knowledge, and experience have had a tremendous impact on the contents of this book. Thank you to: § Jim Stetor, Manager WebSphere Execution Team § David R. Draeger, WebSphere Software Engineer and member of the WebSphere Execution Team § Thomas R. Gissel, WebSphere Software Engineer and Senior member of the WebSphere Execution Team § Andrew McCright, WebSphere Software Engineer and member of the WebSphere Execution Team § Keith McGuinnes, WebSphere Software Engineer, and member of the WebSphere Execution Team We would also like to thank John E. Botsford, IBM Retail Publishing, who helped with the IBM software included on the CD. Finally, we would like to thank the amazing team at Osborne/McGraw-Hill including: § Lisa Bandini, Production Manager § David Zielonka, Managing Editor § Wendy Rinaldi, Editorial Director § Nancy Maragioglio, Senior Acquisitions Editor § Madhu Prasher, Project Editor § Jenn Tust, Project Editor § Timothy Madrid, Acquisitions Coordinator § Emily Rader, Copy Editor § Lisa Theobald, Copy Editor § Nancy McLaughlin, Proofreader § Cheryl Abel, Proofreader § Deidre Dolce, Proofreader § Lyssa Wald, Illustration Supervisor § Michael Mueller, Illustrator § Melinda Moore Lytle, DTP Composition Specialist § Elizabeth Jang, DTP Composition Specialist § John Patrus, DTP Composition Specialist § Valerie Robbins, Indexer We'd also like to thank Jan Benes and his team at Apollo Publishing Services, the lead compositors. This is the seventh book we have authored; we have never worked with such a great team as this one-thank you! -Ori & Ron About the Authors Ron Ben-Natan is Chief Technology Officer at ViryaNet Inc.-a software provider of wireless workforce management and field service solutions. Prior to that he worked for companies including Intel, Merrill Lynch, J.P. Morgan, and AT&T Bell Laboratories. He has a Ph.D. in computer science in the field of distributed computing and has been architecting and developing distributed applications for over 15 years. His hobby is writing about how technology is used to solve real problems, and he has authored books titled CORBA, Objects on the Web, CORBA on the Web, IBM SanFrancisco Developer's Guide, IBM WebSphere Starter Kit, and Integrating Service Level Agreements as well as numerous articles and tutorials. He can be reached at [email protected]. Ori Sasson is an independent software consultant involved in several global projects deployed in Switzerland, Singapore, and Israel. He has a B.S. and M.S. in computer science and mathematics from the Hebrew University of Jerusalem and is currently pursuing a Ph.D. in theoretical computer science. He has co-authored several books, including IBM WebSphere Starter Kit and IBM SanFrancisco Developer's Guide, both published by McGraw-Hill. Table of Contents IBM WebSphere Application Server - The Complete Reference Part I - Getting Started Chapter 1 - What Is WebSphere? Chapter 2 - Installing and Starting WebSphere Chapter 3 - Hello World (Wide Web) Chapter 4 - Hello Servlets and JSPs Chapter 5 - Hello EJBs Part II - WebSphere Technologies Chapter 6 - Web Servers and Java Application Servers Chapter 7 - Servlets and JavaServer Pages Chapter 8 - Common Object Request Broker Architecture Chapter 9 - Internet Inter-ORB Protocol Chapter 10 - JavaBeans Chapter 11 - Enterprise JavaBeans Chapter 12 - Extensible Markup Language (XML) Chapter 13 - Java Security Chapter 14 - Java Messaging Service Chapter 15 - Java 2 Enterprise Edition Part III - Development Environments for WebSphere Applications Chapter 16 - WebSphere Studio Application Developer Chapter 17 - VisualAge for Java Part IV - Core Services Chapter 18 - Connection Pooling and Data Access Beans Chapter 19 - WebSphere Security Services Chapter 20 - Lightweight Directory Access Protocol Support Chapter 21 - WebSphere Application Logging Part V - Developing Servlets and JavaServer Pages Chapter 22 - HTTP Servlets Chapter 23 - Servlet Sessions Chapter 24 - WebSphere-Specific Servlet Issues Chapter 25 - JSP Elements Chapter 26 - JSP Examples Chapter 27 - Custom Tag Libraries Chapter 28 - Debugging Servlets and JSPs Using VisualAge Part VI - Developing EJB Chapter 29 - Session Beans Chapter 30 - Entity Beans Chapter 31 - EJB Transactions and Security Chapter 32 - Message-Driven Beans Chapter 33 - IBM EJB Extensions Chapter 34 - Using EJB in a Multitiered Application Part VII - Using XML Chapter 35 - Writing XML E-Business Applications Chapter 36 - Application of XSL Transformations Chapter 37 - Web Services: SOAP, WSDL, and UDDI Chapter 38 - Deploying Web Services on WebSphere Part VIII - Internationalization and Localization Chapter 39 - Java Support Features for Internationalization Chapter 40 - Building Multilingual Applications Part IX - Administering WebSphere Sites Chapter 41 - Deploying WebSphere for Scalability and Fault Tolerance Chapter 42 - The WebSphere Administrative Console Chapter 43 - WebSphere Administration Scripts Chapter 44 - Administering WebSphere Security Index List of Figures List of Tables List of Listings Part I: Getting Started Chapter List Chapter 1: What Is WebSphere? Chapter 2: Installing and Starting WebSphere Chapter 3: Hello World (Wide Web) Chapter 4: Hello Servlets and JSPs Chapter 5: Hello EJBs 1