Advanced Swing Graphical User Interface

Document Sample
scope of work template
							                           Contents


      Preface                                                 xxi
1     Introduction                                             1
1.1   Introduction                                              2
1.2   Architecture of the Book                                  3
      1.2.1      Advanced GUI, Graphics and JavaBeans           3
      1.2.2      Distributed Systems                            4
      1.2.3      Web Services                                   5
      1.2.4      Enterprise Java                                5
      1.2.5      Enterprise Case Study                          6
      1.2.6      XML                                            7
1.3   Tour of the Book                                          7
1.4   Running Example Code                                     18
1.5   Design Patterns                                          19
      1.5.1      History of Object-Oriented Design Patterns    20
      1.5.2      Design Patterns Discussion                    22
      1.5.3      Concurrency Patterns                          25
      1.5.4      Architectural Patterns                        26
      1.5.5      Further Study on Design Patterns              27

2  Advanced Swing Graphical User Interface
Components                                                    29
2.1   Introduction                                             30
2.2   WebBrowser Using JEditorPane and JToolBar                30
      2.2.1      Swing Text Components and HTML Rendering      31
      2.2.2      Swing Toolbars                                33
2.3   Swing Actions                                            39
2.4   JSplitPane and JTabbedPane                               45
VIII                                                                 Contents


2.5    Multiple-Document Interfaces                                       52
2.6    Drag and Drop                                                      56
2.7    Internationalization                                               62
2.8    Accessibility                                                      71
2.9    Internet and World Wide Web Resources                              78

3      Model-View-Controller                                              85
3.1    Introduction                                                       86
3.2    Model-View-Controller Architecture                                 86
3.3    Observable Class and Observer Interface                            88
3.4    JList                                                             107
3.5    JTable                                                            111
3.6    JTree                                                             115
       3.6.1      Using DefaultTreeModel                                 117
       3.6.2      Custom TreeModel Implementation                        123

4      Graphics Programming with Java 2D and Java 3D                     135
4.1    Introduction                                                      136
4.2    Coordinates, Graphics Contexts and Graphics Objects               136
4.3    Java 2D API                                                       138
       4.3.1      Java 2D Shapes                                         140
       4.3.2      Java 2D Image Processing                               146
4.4    Java 3D API                                                       160
       4.4.1      Obtaining and Installing the Java 3D API               161
       4.4.2      Java 3D Scenes                                         161
       4.4.3      A Java 3D Example                                      163
4.5    A Java 3D Case Study: A 3D Game with Custom Behaviors             179

5    Case Study: Java 2D GUI Application with
Design Patterns                                                          219
5.1    Introduction                                                      220
5.2    Application Overview                                              220
5.3    MyShape Class Hierarchy                                           221
5.4    Deitel DrawingModel                                               242
5.5    Deitel Drawing Views                                              254
5.6    Deitel Drawing Controller Logic                                   260
       5.6.1      MyShapeControllers for Processing User Input           260
       5.6.2      MyShapeControllers and Factory Method Design Pattern   272
       5.6.3      Drag-and-Drop Controller                               276
5.7    DrawingInternalFrame Component                                    287
5.8    ZoomDialog, Action and Icon Components                            304
5.9    DeitelDrawing Application                                         309

6      JavaBeans Component Model                                         321
6.1    Introduction                                                      322
6.2    Using Beans in Forte for Java Community Edition                   323
Contents                                                                         IX



6.3    Preparing a Class to be a JavaBean                                      337
6.4    Creating a JavaBean: Java Archive Files                                 340
6.5    JavaBean Properties                                                     345
6.6    Bound Properties                                                        347
6.7    Indexed Properties and Custom Events                                    355
6.8    Customizing JavaBeans for Builder Tools                                 364
       6.8.1      PropertyEditors                                              371
       6.8.2      Customizers                                                  375
6.9    Internet and World Wide Web Resources                                   379

7      Security                                                                386
7.1    Introduction                                                            387
7.2    Ancient Ciphers to Modern Cryptosystems                                 388
7.3    Secret-Key Cryptography                                                 389
7.4    Public-Key Cryptography                                                 390
7.5    Cryptanalysis                                                           393
7.6    Key Agreement Protocols                                                 393
7.7    Key Management                                                          394
7.8    Java Cryptography Extension (JCE)                                       395
       7.8.1      Password-Based Encoding with JCE                             395
       7.8.2      Decorator Design Pattern                                     405
7.9    Digital Signatures                                                      406
7.10   Public-Key Infrastructure, Certificates and Certification Authorities   407
       7.10.1     Java Keystores and keytool                                   409
7.11   Java Policy Files                                                       410
7.12   Digital Signatures for Java Code                                        413
7.13   Authentication                                                          417
       7.13.1     Kerberos                                                     417
       7.13.2     Single Sign-On                                               417
       7.13.3     Java Authentication and Authorization Service (JAAS)         418
7.14   Secure Sockets Layer (SSL)                                              423
       7.14.1     Java Secure Socket Extension (JSSE)                          424
7.15   Java Language Security and Secure Coding                                429
7.16   Internet and World Wide Web Resources                                   430

8      Java Database Connectivity (JDBC)                                       444
8.1    Introduction                                                            445
8.2    Relational-Database Model                                               446
8.3    Relational Database Overview: The books Database                        447
8.4    Structured Query Language (SQL)                                         452
       8.4.1      Basic SELECT Query                                           453
       8.4.2      WHERE Clause                                                 454
       8.4.3      ORDER BY Clause                                              456
       8.4.4      Merging Data from Multiple Tables: Joining                   459
       8.4.5      INSERT INTO Statement                                        460
       8.4.6      UPDATE Statement                                             461
       8.4.7      DELETE FROM Statement                                        462
X                                                                 Contents


8.5    Creating Database books in Cloudscape                          463
8.6    Manipulating Databases with JDBC                               464
       8.6.1      Connecting to and Querying a JDBC Data Source       464
       8.6.2      Querying the books Database                         470
8.7    Case Study: Address-Book Application                           479
       8.7.1      PreparedStatements                                  480
       8.7.2      Transaction Processing                              482
       8.7.3      Address-Book Application                            482
8.8    Stored Procedures                                              515
8.9    Batch Processing                                               515
8.10   Processing Multiple ResultSets or Update Counts                517
8.11   Updatable ResultSets                                           518
8.12   JDBC 2.0 Optional Package javax.sql                            519
       8.12.1     DataSource                                          519
       8.12.2     Connection Pooling                                  519
       8.12.3     RowSets                                             520
8.13   Internet and World Wide Web Resources                          520

9      Servlets                                                      530
9.1    Introduction                                                   531
9.2    Servlet Overview and Architecture                              533
       9.2.1      Interface Servlet and the Servlet Life Cycle        534
       9.2.2      HttpServlet Class                                   536
       9.2.3      HttpServletRequest Interface                        537
       9.2.4      HttpServletResponse Interface                       538
9.3    Handling HTTP get Requests                                     539
       9.3.1      Setting Up the Apache Tomcat Server                 543
       9.3.2      Deploying a Web Application                         545
9.4    Handling HTTP get Requests Containing Data                     549
9.5    Handling HTTP post Requests                                    552
9.6    Redirecting Requests to Other Resources                        556
9.7    Session Tracking                                               559
       9.7.1      Cookies                                             560
       9.7.2      Session Tracking with HttpSession                   569
9.8    Multi-Tier Applications: Using JDBC from a Servlet             577
9.9    HttpUtils Class                                                584
9.10   Internet and World Wide Web Resources                          585

10     JavaServer Pages (JSP)                                        593
10.1   Introduction                                                   594
10.2   JavaServer Pages Overview                                      595
10.3   A First JavaServer Page Example                                596
10.4   Implicit Objects                                               598
10.5   Scripting                                                      599
       10.5.1     Scripting Components                                600
       10.5.2     Scripting Example                                   601
10.6   Standard Actions                                               604
Contents                                                                     XI



        10.6.1     <jsp:include> Action                                    605
        10.6.2     <jsp:forward> Action                                    610
        10.6.3     <jsp:plugin> Action                                     613
        10.6.4     <jsp:useBean> Action                                    617
10.7    Directives                                                         634
        10.7.1     page Directive                                          634
        10.7.2     include Directive                                       636
10.8    Custom Tag Libraries                                               638
        10.8.1     Simple Custom Tag                                       639
        10.8.2     Custom Tag with Attributes                              643
        10.8.3     Evaluating the Body of a Custom Tag                     647
10.9    Internet and World Wide Web Resources                              653

11      Case Study: Servlet and JSP Bookstore                              660
11.1    Introduction                                                       661
11.2    Bookstore Architecture                                             662
11.3    Entering the Bookstore                                             664
11.4    Obtaining the Book List from the Database                          667
11.5    Viewing a Book’s Details                                           676
11.6    Adding an Item to the Shopping Cart                                683
11.7    Viewing the Shopping Cart                                          686
11.8    Checking Out                                                       689
11.9    Processing the Order                                               693
11.10   Deploying the Bookstore Application in J2EE 1.2.1                  694
        11.10.1 Configuring the books Data Source                          695
        11.10.2 Launching the Cloudscape Database and J2EE Servers         695
        11.10.3 Launching the J2EE Application Deployment Tool             696
        11.10.4 Creating the Bookstore Application                         697
        11.10.5 Creating BookServlet and AddToCartServlet Web Components   698
        11.10.6 Adding Non-Servlet Components to the Application           704
        11.10.7 Specifying the Web Context, Resource References, JNDI
                   Names and Welcome Files                                 706
        11.10.8 Deploying and Executing the Application                    709

12 Java-Based Wireless Applications
Development and J2ME                                                       716
12.1    Introduction                                                       717
12.2    WelcomeServlet Overview                                            720
12.3    TipTestServlet Overview                                            726
        12.3.1     Internet Explorer Request                               739
        12.3.2     WAP Request                                             746
        12.3.3     Pixo i-mode Request                                     751
        12.3.4     J2ME Client Request                                     755
12.4    Java 2 Micro Edition                                               757
        12.4.1     Connected Limited Device Configuration (CLDC)           758
        12.4.2     Mobile Information Device Profile (MIDP)                759
XII                                                                             Contents


       12.4.3      TipTestMIDlet Overview                                           761
12.5   Installation Instructions                                                    781
12.6   Internet and World Wide Web Resources                                        785

13     Remote Method Invocation                                                    790
13.1   Introduction                                                                 791
13.2   Case Study: Creating a Distributed System with RMI                           792
13.3   Defining the Remote Interface                                                792
13.4   Implementing the Remote Interface                                            793
13.5   Compiling and Executing the Server and the Client                            807
13.6   Case Study: Deitel Messenger with Activatable Server                         809
       13.6.1     Activatable Deitel Messenger ChatServer                           810
       13.6.2     Deitel Messenger Client Architecture and Implementation           820
       13.6.3     Running the Deitel Messenger Server and Client Applications       836
13.7   Internet and World Wide Web Resources                                        840

14     Session EJBs and Distributed Transactions                                   846
14.1   Introduction                                                                 847
14.2   EJB Overview                                                                 847
       14.2.1     Remote Interface                                                  848
       14.2.2     Home Interface                                                    848
       14.2.3     EJB Implementation                                                849
       14.2.4     EJB Container                                                     849
14.3   Session Beans                                                                849
       14.3.1     Stateful Session EJBs                                             849
       14.3.2     Deploying Session EJBs                                            862
       14.3.3     Stateless Session EJBs                                            869
14.4   EJB Transactions                                                             879
       14.4.1     MoneyTransfer EJB Home and Remote Interfaces                      879
       14.4.2     Bean-Managed Transaction Demarcation                              881
       14.4.3     Container-Managed Transaction Demarcation                         886
       14.4.4     MoneyTransfer EJB Client                                          892
       14.4.5     Deploying the MoneyTransfer EJB                                   898
14.5   Internet and World Wide Web Resources                                        900

15     Entity EJBs                                                                 904
15.1   Introduction                                                                 905
15.2   Entity EJB Overview                                                          905
15.3   Employee Entity EJB                                                          906
15.4   Employee EJB Home and Remote Interfaces                                      906
15.5   Employee EJB with Bean-Managed Persistence                                   908
       15.5.1     Employee EJB Implementation                                       908
       15.5.2     Employee EJB Deployment                                           918
15.6   Employee EJB with Container-Managed Persistence                              920
15.7   Employee EJB Client                                                          925
15.8   Internet and World Wide Web Resources                                        934
Contents                                                           XIII



16     Messaging with JMS                                        937
16.1   Introduction                                               938
16.2   Installation and Configuration of J2EE 1.3                 939
16.3   Point-To-Point Messaging                                   940
       16.3.1     Voter Application: Overview                     940
       16.3.2     Voter Application: Sender Side                  941
       16.3.3     Voter Application: Receiver Side                945
       16.3.4     Voter Application: Configuring and Running      951
16.4   Publish/Subscribe Messaging                                951
       16.4.1     Weather Application: Overview                   952
       16.4.2     Weather Application: Publisher Side             953
       16.4.3     Weather Application: Subscriber Side            958
       16.4.4     Weather Application: Configuring and Running    967
16.5   Message-Driven Enterprise JavaBeans                        968
       16.5.1     Voter Application: Overview                     968
       16.5.2     Voter Application: Receiver Side                969
       16.5.3     Voter Application: Configuring and Running      978

17     Enterprise Java Case Study: Architectural Overview         990
17.1   Introduction                                               991
17.2   Deitel Bookstore                                           992
17.3   System Architecture                                        992
17.4   Enterprise JavaBeans                                       993
       17.4.1     Entity EJBs                                     993
       17.4.2     Stateful Session EJBs                           995
17.5   Servlet Controller Logic                                   995
17.6   XSLT Presentation Logic                                    995

18 Enterprise Java Case Study: Presentation
and Controller Logic                                             1009
18.1   Introduction                                               1010
18.2   XMLServlet Base Class                                      1011
18.3   Shopping Cart Servlets                                     1022
       18.3.1     AddToCartServlet                                1023
       18.3.2     ViewCartServlet                                 1023
       18.3.3     RemoveFromCartServlet                           1034
       18.3.4     UpdateCartServlet                               1034
       18.3.5     CheckoutServlet                                 1039
18.4   Product Catalog Servlets                                   1040
       18.4.1     GetAllProductsServlet                           1040
       18.4.2     GetProductServlet                               1046
       18.4.3     ProductSearchServlet                            1049
18.5   Customer Management Servlets                               1053
       18.5.1     RegisterServlet                                 1053
       18.5.2     LoginServlet                                    1057
       18.5.3     ViewOrderHistoryServlet                         1060
XIV                                                            Contents


       18.5.4   ViewOrderServlet                                  1064
       18.5.5   GetPasswordHintServlet                            1067

19     Enterprise Java Case Study: Business Logic Part 1         1073
19.1   Introduction                                               1074
19.2   EJB Architecture                                           1074
19.3   ShoppingCart Implementation                                1075
       19.3.1     ShoppingCart Remote Interface                   1075
       19.3.2     ShoppingCartEJB Implementation                  1077
       19.3.3     ShoppingCartHome Interface                      1084
19.4   Product Implementation                                     1085
       19.4.1     Product Remote Interface                        1085
       19.4.2     ProductEJB Implementation                       1086
       19.4.3     ProductHome Interface                           1088
       19.4.4     ProductModel                                    1089
19.5   Order Implementation                                       1094
       19.5.1     Order Remote Interface                          1095
       19.5.2     OrderEJB Implementation                         1095
       19.5.3     OrderHome Interface                             1101
       19.5.4     OrderModel                                      1101
19.6   OrderProduct Implementation                                1107
       19.6.1     OrderProduct Remote Interface                   1107
       19.6.2     OrderProductEJB Implementation                  1108
       19.6.3     OrderProductHome Interface                      1110
       19.6.4     OrderProductPK Primary-Key Class                1111
       19.6.5     OrderProductModel                               1113

20     Enterprise Java Case Study: Business Logic Part 2         1117
20.1   Introduction                                               1118
20.2   Customer Implementation                                    1118
       20.2.1     Customer Remote Interface                       1119
       20.2.2     CustomerEJB Implementation                      1119
       20.2.3     CustomerHome Interface                          1126
       20.2.4     CustomerModel                                   1127
20.3   Address Implementation                                     1131
       20.3.1     Address Remote Interface                        1134
       20.3.2     AddressEJB Implementation                       1134
       20.3.3     AddressHome Interface                           1138
       20.3.4     AddressModel                                    1138
20.4   SequenceFactory Implementation                             1144
       20.4.1     SequenceFactory Remote Interface                1144
       20.4.2     SequenceFactoryEJB Implementation               1145
       20.4.3     SequenceFactoryHome Interface                   1147
20.5   Deitel Bookstore Application Deployment with J2EE          1149
       20.5.1     Deploying Deitel Bookstore CMP Entity EJBs      1149
       20.5.2     Deploying Deitel Bookstore Servlets             1156
Contents                                                              XV



21     Application Servers                                         1161
21.1   Introduction                                                 1162
21.2   J2EE Specification and Benefits                              1162
21.3   Commercial Application Servers                               1163
       21.3.1     BEA WebLogic 6.0                                  1163
       21.3.2     iPlanet Application Server 6.0                    1164
       21.3.3      IBM WebSphere Advanced Application Server 4.0    1165
       21.3.4     JBoss 2.2.2 Application Server                    1165
21.4   Deploying the Deitel Bookstore on BEA WebLogic               1165
21.5   Deploying the Deitel Bookstore on IBM WebSphere              1191
21.6   Internet and World Wide Web Resources                        1193

22     Jini                                                        1196
22.1   Introduction                                                 1197
22.2   Installing Jini                                              1198
22.3   Configuring the Jini Runtime Environment                     1198
22.4   Starting the Required Services                               1199
22.5   Running the Jini LookupBrowser                               1203
22.6   Discovery                                                    1204
       22.6.1     Unicast Discovery                                 1204
       22.6.2     Multicast Discovery                               1209
22.7   Jini Service and Client Implementations                      1214
       22.7.1     Service Interfaces and Supporting Classes         1214
       22.7.2     Service Proxy and Service Implementations         1217
       22.7.3     Registering the Service with Lookup Services      1220
       22.7.4     Jini Service Client                               1223
22.8   Introduction to High-Level Helper Utilities                  1232
       22.8.1     Discovery Utilities                               1232
       22.8.2     Entry Utilities                                   1242
       22.8.3     Lease Utilities                                   1244
       22.8.4     JoinManager Utility                               1248
       22.8.5     Service Discovery Utilities                       1252
22.9   Internet and World Wide Web Resources                        1253

23     JavaSpaces                                                  1258
23.1  Introduction                                                  1259
23.2  JavaSpaces Service Properties                                 1260
23.3  JavaSpaces Service                                            1260
23.4  Discovering the JavaSpaces Service                            1262
23.5  JavaSpace Interface                                           1264
23.6  Defining an Entry                                             1265
23.7  Write Operation                                               1266
23.8  Read and Take Operations                                      1269
      23.8.1     Read Operation                                     1269
      23.8.2     Take Operation                                     1273
23.9 Notify Operation                                               1276
23.10 Method snapshot                                               1281
XVI                                                                  Contents


23.11 Updating Entries with Jini Transaction Service                    1284
      23.11.1 Defining the User Interface                               1285
      23.11.2 Discovering the TransactionManager Service                1287
      23.11.3 Updating an Entry                                         1289
23.12 Case Study: Distributed Image Processing                          1294
      23.12.1 Defining an Image Processor                               1295
      23.12.2 Partitioning an Image into Smaller Pieces                 1301
      23.12.3 Compiling and Running the Example                         1312
23.13 Internet and World Wide Web Resources                             1314

24     Java Management Extensions (JMX) (on CD)                        1319
24.1   Introduction                                                     1320
24.2   Installation                                                     1322
24.3   Case Study                                                       1322
       24.3.1     Instrument Resources                                  1322
       24.3.2     Implementation of the JMX Management Agent            1338
       24.3.3     Broadcasting and Receiving Notifications              1342
       24.3.4     Management Application                                1346
       24.3.5     Compiling and Running the Example                     1357
24.4   Internet and World Wide Web Resources                            1360

25     Jiro (on CD)                                                    1364
25.1  Introduction                                                      1365
25.2  Installation                                                      1366
25.3  Starting Jiro                                                     1367
25.4  Dynamic vs. Static Services                                       1369
25.5  Dynamic Services                                                  1369
      25.5.1     Dynamic-Service Implementation                         1370
25.6 Static Services                                                    1380
      25.6.1     Locating Static Services with Class ServiceFinder      1380
      25.6.2     Event Service                                          1381
      25.6.3     Log Service                                            1389
      25.6.4     Scheduling Service                                     1391
25.7 Dynamic Service Deployment                                         1392
      25.7.1     Dynamic–Service Usage                                  1395
25.8 Management Policies                                                1409
      25.8.1     Policy–Management Deployment                           1420
25.9 Closing Notes on the Printer Management Solution                   1428
25.10 Internet and World Wide Web Resources                             1429

26 Common Object Request Broker Architecture
(CORBA): Part 1 (on CD)                                                1435
26.1   Introduction                                                     1436
26.2   Step-by-Step                                                     1441
26.3   First Example: SystemClock                                       1442
       26.3.1     SystemClock.idl                                       1443
       26.3.2     SystemClockImpl.java                                  1444
Contents                                                                         XVII



      26.3.3     SystemClockClient.java                                         1449
      26.3.4     Running the Example                                            1452
26.4 Technical/Architectural Overview                                           1453
26.5 CORBA Basics                                                               1458
26.6 Example: AlarmClock                                                        1468
      26.6.1     AlarmClock.idl                                                 1468
      26.6.2     AlarmClockImpl.java                                            1469
      26.6.3     AlarmClockClient.java                                          1472
26.7 Distributed Exceptions                                                     1476
26.8 Case Study: Chat                                                           1480
      26.8.1     chat.idl                                                       1482
      26.8.2     ChatServerImpl.java                                            1483
      26.8.3     DeitelMessenger.java                                           1488
      26.8.4     Running Chat                                                   1493
      26.8.5     Issues                                                         1493
26.9 Comments and Comparisons                                                   1498
26.10 Internet and World Wide Web Resources                                     1499

27 Common Object Request Broker Architecture
(CORBA): Part 2 (on CD)                                                        1508
27.1   Introduction                                                             1509
27.2   Static Invocation Interface (SII), Dynamic Invocation Interface (DII)
       and Dynamic Skeleton Interface (DSI)                                     1510
27.3   BOAs, POAs and TIEs                                                      1514
27.4   CORBAservices                                                            1516
       27.4.1     Naming Service                                                1516
       27.4.2     Security Service                                              1517
       27.4.3     Object Transaction Service                                    1518
       27.4.4     Persistent State Service                                      1519
       27.4.5     Event and Notification Services                               1520
27.5   EJBs and CORBAcomponents                                                 1523
27.6   CORBA vs. RMI                                                            1529
       27.6.1     When to Use RMI                                               1529
       27.6.2     When to Use CORBA                                             1530
       27.6.3     RMI-IIOP                                                      1530
27.7   RMIMessenger Case Study Ported to RMI-IIOP                               1531
       27.7.1     ChatServer RMI-IIOP Implementation                            1532
       27.7.2     ChatClient RMI-IIOP Implementation                            1538
       27.7.3     Compiling and Running the ChatServer and ChatClient           1542
27.8   Future Directions                                                        1543
27.9   Internet and World Wide Web Resources                                    1543

28     Peer-to-Peer Applications and JXTA                                      1548
28.1   Introduction                                                             1549
28.2   Client/Server and Peer-to-Peer Applications                              1549
28.3   Centralized vs. Decentralized Network Applications                       1550
28.4   Peer Discovery and Searching                                             1551
XVIII                                                                      Contents


28.5  Case Study: Deitel Instant Messenger                                    1551
28.6  Defining the Service Interface                                          1553
28.7  Defining the Service implementation                                     1555
28.8  Registering the Service                                                 1562
28.9  Find Other Peers                                                        1564
28.10 Compiling and Running the Example                                       1571
28.11 Improving Deitel Instant Messenger                                      1571
28.12 Deitel Instant Messenger with Multicast Sockets                         1572
      28.12.1 Registering the Peer                                            1572
      28.12.2 Finding Other Peers                                             1577
28.13 Introduction to JXTA                                                    1588
28.14 Internet and World Wide Web Resources                                   1590


29      Introduction to Web Services and SOAP                                1594
29.1    Introduction                                                          1595
29.2    Simple Object Access Protocol (SOAP)                                  1596
29.3    SOAP Weather Service                                                  1602
29.4    Internet and World Wide Web Resources                                 1608


A       Creating Markup with XML (on CD)                                     1611
A.1     Introduction                                                          1612
A.2     Introduction to XML Markup                                            1612
A.3     Parsers and Well-Formed XML Documents                                 1615
A.4     Characters                                                            1616
        A.4.1      Characters vs. Markup                                      1616
        A.4.2      White Space, Entity References and Built-In Entities       1616
A.5     CDATA Sections and Processing Instructions                            1618
A.6     XML Namespaces                                                        1620
A.7     Internet and World Wide Web Resources                                 1623


B       Document Type Definition (DTD) (on CD)                               1627
B.1     Introduction                                                          1628
B.2     Parsers, Well-Formed and Valid XML Documents                          1628
B.3     Document Type Declaration                                             1629
B.4     Element Type Declarations                                             1630
        B.4.1      Sequences, Pipe Characters and Occurrence Indicators       1631
        B.4.2      EMPTY, Mixed Content and ANY                               1634
B.5     Attribute Declarations                                                1636
B.6     Attribute Types                                                       1638
        B.6.1      Tokenized Attribute Type (ID, IDREF, ENTITY, NMTOKEN)      1638
        B.6.2      Enumerated Attribute Types                                 1643
B.7     Conditional Sections                                                  1644
B.8     Whitespace Characters                                                 1645
B.9     Internet and World Wide Web Resources                                 1647
Contents                                                XIX



C     Document Object Model (DOM™) (on CD)            1652
C.1   Introduction                                     1653
C.2   DOM with Java                                    1654
C.3   Setup Instructions                               1657
C.4   DOM Components                                   1657
C.5   Creating Nodes                                   1665
C.6   Traversing the DOM                               1668
C.7   Internet and World Wide Web Resources            1671

D    XSL: Extensible Stylesheet Language
Transformations (XSLT) (on CD)                        1676
D.1   Introduction                                     1677
D.2   Applying XSLTs with Java                         1677
D.3   Templates                                        1679
D.4   Creating Elements and Attributes                 1680
D.5   Iteration and Sorting                            1683
D.6   Conditional Processing                           1687
D.7   Combining Style Sheets                           1690
D.8   Variables                                        1695
D.9   Internet and World Wide Web Resources            1695

E     Downloading and Installing J2EE 1.2.1 (on CD)   1699
E.1   Introduction                                     1699
E.2   Installation                                     1699
E.3   Configuration                                    1700
      E.3.1      JDBC Drivers and Data Sources         1700
      E.3.2      HTTP Properties                       1700

F     Java Community ProcessSM (JCP) (on CD)          1701
F.1   Introduction                                     1701
F.2   Participants                                     1701
      F.2.1      Program Management Office             1701
      F.2.2      Executive Committee                   1701
      F.2.3      Experts                               1702
      F.2.4      Members                               1702
      F.2.5      Public Participation                  1702
F.3   Java Community Process                           1702
      F.3.1      Initiation Phase                      1702
      F.3.2      Community Draft Phase                 1703
      F.3.3      Public Draft Phase                    1704
      F.3.4      Final Phase                           1704
      F.3.5      Maintenance Phase                     1704

G     Java Native Interface (JNI) (on CD)             1705
G.1   Introduction                                     1706
XX                                                          Contents


G.2   Getting Started with Java Native Interface               1706
G.3   Accessing Java Methods and Objects from Native Code      1710
G.4   JNI and Arrays                                           1718
G.5   Handling Exceptions with JNI                             1722
G.6   Internet and World Wide Web Resources                    1733

H     Career Opportunities (on CD)                            1738
H.1   Introduction                                             1739
H.2   Resources for the Job Seeker                             1740
H.3   Online Opportunities for Employers                       1741
      H.3.1      Posting Jobs Online                           1743
      H.3.2      Problems with Recruiting on the Web           1745
      H.3.3      Diversity in the Workplace                    1745
H.4   Recruiting Services                                      1746
      H.4.1      Testing Potential Employees Online            1747
H.5   Career Sites                                             1748
      H.5.1      Comprehensive Career Sites                    1748
      H.5.2      Technical Positions                           1749
      H.5.3      Wireless Positions                            1750
      H.5.4      Contracting Online                            1750
      H.5.5      Executive Positions                           1751
      H.5.6      Students and Young Professionals              1752
      H.5.7      Other Online Career Services                  1753
H.6   Internet and World Wide Web Resources                    1754

I     Unicode® (on CD)                                        1762
I.1   Introduction                                             1763
I.2   Unicode Transformation Formats                           1764
I.3   Characters and Glyphs                                    1765
I.4   Advantages/Disadvantages of Unicode                      1766
I.5   Unicode Consortium’s Web Site                            1766
I.6   Using Unicode                                            1767
I.7   Character Ranges                                         1770

      Index                                                   1774

						
Related docs