Core Web Programming, Volumes I & II Includes index [2nd ed]
0130897930, 1681691701, 1941961991, 9780130897930
Becoming a Web developer these days requires expertise in a variety of disparate languages and tools and usually require
239
101
2MB
English
Pages xli, 1398 Seiten)
[1441]
Year 2001
Report DMCA / Copyright
DOWNLOAD PDF FILE
Table of contents :
COVER......Page 1
CONTENTS......Page 4
INTRODUCTION......Page 34
Real Code for Real Programmers......Page 35
How This Book Is Organized......Page 36
Conventions......Page 39
About the Authors......Page 40
ACKNOWLEDGMENTS......Page 42
PART 1 THE HYPERTEXT MARKUP LANGUAGE......Page 44
1.1 The Hyper Text Markup Language......Page 48
1.2 HTML 4.0 and Other HTML Standards......Page 50
1.3 Steps to Publish a Document on the Web......Page 52
1.4 The Basic Structure of HTML Documents......Page 55
1.5 HEAD—High-Level Information About the Page......Page 59
1.6 BODY—Creating the Main Document......Page 65
1.7 Summary......Page 68
CHAPTER 2 BLOCK-LEVEL ELEMENTS IN HTML 4.0......Page 72
2.1 Headings......Page 73
2.2 Basic Text Elements......Page 75
2.3 Numbered, Bulleted, and Indented Lists......Page 78
2.4 Tables......Page 84
2.6 Miscellaneous Block-Level Elements......Page 97
2.7 Summary......Page 100
3.1 Physical Character Styles......Page 102
3.2 Logical Character Styles......Page 107
3.3 Specifying Hypertext Links......Page 110
3.4 Embedded Images......Page 113
3.5 Client-Side Image Maps......Page 118
3.6 Embedding Other Objects in Documents......Page 122
3.7 Controlling Line Breaks......Page 129
3.8 Summary......Page 130
CHAPTER 4 FRAMES......Page 132
4.1 Frame Document Template......Page 133
4.2 Specifying Frame Layout......Page 134
4.3 Specifying the Content of Frame Cells......Page 139
4.4 Targeting Frame Cells......Page 143
4.5 Solving Common Frame Problems......Page 146
4.6 Inline Frames......Page 152
4.7 Summary......Page 156
CHAPTER 5 CASCADING STYLE SHEETS......Page 158
5.1 Specifying Style Rules......Page 159
5.2 Using External and Local Style Sheets......Page 161
5.3 Selectors......Page 164
5.4 Cascading: Style Sheet Precedence Rules......Page 168
5.5 Font Properties......Page 169
5.6 Foreground and Background Properties......Page 175
5.7 Text Properties......Page 178
5.8 Properties of the Bounding Box......Page 182
5.9 Images and Floating Elements......Page 186
5.10 List Properties......Page 189
5.11 Standard Property Units......Page 190
5.12 Layers......Page 191
5.13 Summary......Page 200
PART 2 JAVA PROGRAMMING......Page 201
CHAPTER 6 GETTING STARTED WITH JAVA......Page 204
6.1 Unique Features of Java......Page 205
6.2 Myths About Java......Page 214
6.3 Java Versions......Page 218
6.4 Getting Started: Nuts and Bolts......Page 221
6.5 Some Simple Java Programs......Page 225
6.6 Summary......Page 230
7.1 Instance Variables......Page 234
7.2 Methods......Page 237
7.3 Constructors and the "this" Reference......Page 239
7.4 Destructors......Page 242
7.5 Overloading......Page 243
7.6 Public Version in Separate File......Page 247
7.7 Javadoc......Page 252
7.8 Inheritance......Page 259
7.9 Interfaces and Abstract Classes......Page 264
7.10 Packages, Classpath, and JAR Archives......Page 273
7.11 Modifiers in Declarations......Page 279
7.12 Summary......Page 282
8.1 Rules of Syntax......Page 286
8.2 Primitive Types......Page 288
8.3 Operators, Conditionals, Iteration......Page 291
8.4 The Math Class......Page 302
8.5 Input and Output......Page 306
8.6 Execution of Non-Java Programs......Page 309
8.7 Reference Types......Page 316
8.8 Strings......Page 320
8.9 Arrays......Page 327
8.10 Vectors......Page 331
8.11 Example: A Simple Binary Tree......Page 334
8.12 Exceptions......Page 339
8.13 Summary......Page 346
9.1 What Are Applets?......Page 348
9.2 Creating an Applet......Page 349
9.3 An Example Applet......Page 352
9.4 The Applet Life Cycle......Page 355
9.5 Other Applet Methods......Page 357
9.6 The HTML APPLET Element......Page 363
9.7 Reading Applet Parameters......Page 365
9.8 HTML OBJECT Element......Page 369
9.9 The Java Plug-In......Page 371
9.10 Graphical Applications......Page 374
9.11 Graphics Operations......Page 375
9.12 Drawing Images......Page 380
9.13 Preloading Images......Page 387
9.14 Controlling Image Loading: Waiting for Images and Checking Status......Page 391
9.15 Summary......Page 398
CHAPTER 10 JAVA 2D: GRAPHICS IN JAVA 2......Page 402
10.1 Getting Started with Java 2D......Page 403
10.2 Drawing Shapes......Page 409
10.3 Paint Styles......Page 414
10.4 Transparent Drawing......Page 421
10.5 Using Local Fonts......Page 424
10.6 Stroke Styles......Page 426
10.7 Coordinate Transformations......Page 433
10.8 Other Capabilities of Java 2D......Page 437
10.9 Summary......Page 438
CHAPTER 11 HANDLING MOUSE AND KEYBOARD EVENTS......Page 442
11.1 Handling Events with a Separate Listener......Page 443
11.2 Handling Events by Implementing a Listener Interface......Page 447
11.3 Handling Events with Named Inner Classes......Page 449
11.4 Handling Events with Anonymous Inner Classes......Page 450
11.5 The Standard Event Listeners......Page 452
11.6 Behind the Scenes: Low-Level Event Processing......Page 458
11.7 A Spelling-Correcting Textfield......Page 461
11.8 A Whiteboard Class......Page 464
11.9 Summary......Page 468
CHAPTER 12 LAYOUT MANAGERS......Page 470
12.1 The FlowLayout Manager......Page 471
12.2 The BorderLayout Manager......Page 473
12.3 The GridLayout Manager......Page 476
12.4 The CardLayout Manager......Page 479
12.5 GridBagLayout......Page 484
12.6 The BoxLayout Manager......Page 492
12.7 Turning Off the Layout Manager......Page 497
12.8 Effective Use of Layout Managers......Page 498
12.9 Summary......Page 507
CHAPTER 13 AWT COMPONENTS......Page 510
13.1 The Canvas Class......Page 511
13.2 The Component Class......Page 515
13.3 Lightweight Components in Java 1.1......Page 522
13.4 The Panel Class......Page 525
13.5 The Container Class......Page 528
13.7 The ScrollPane Class......Page 530
13.8 The Frame Class......Page 532
13.9 Serializing Windows......Page 540
13.10 The Dialog Class......Page 544
13.11 The FileDialog Class......Page 547
13.12 The Window Class......Page 550
13.13 Handling Events in GUI Controls......Page 551
13.14 The Button Class......Page 555
13.15 The Checkbox Class......Page 561
13.16 Check Box Groups (Radio Buttons)......Page 564
13.17 Choice Menus......Page 567
13.18 List Boxes......Page 572
13.19 The TextField Class......Page 581
13.20 The TextArea Class......Page 586
13.21 The Label Class......Page 588
13.22 Scrollbars and Sliders......Page 593
13.23 Pop-up Menus......Page 599
13.24 Summary......Page 603
CHAPTER 14 BASIC SWING......Page 606
14.1 Getting Started with Swing......Page 607
14.2 The JApplet Component......Page 615
14.3 The JFrame Component......Page 617
14.4 The JLabel Component......Page 619
14.5 The JButton Component......Page 624
14.6 The JPanel Component......Page 628
14.7 The JSlider Component......Page 633
14.8 The JColorChooser Component......Page 637
14.9 Internal Frames......Page 641
14.10 The JOptionPane Component......Page 645
14.11 The JToolBar Component......Page 650
14.12 The JEditorPane Component......Page 657
14.13 Other Simple Swing Components......Page 665
14.14 Summary......Page 669
CHAPTER 15 ADVANCED SWING......Page 672
15.1 Using Custom Data Models and Renderers......Page 673
15.2 JList......Page 674
15.3 JTree......Page 693
15.4 JTable......Page 707
15.5 Swing Component Printing......Page 723
15.6 Swing Threads......Page 734
15.7 Summary......Page 739
CHAPTER 16 CONCURRENT PROGRAMMING WITH JAVA THREADS......Page 742
16.1 Starting Threads......Page 743
16.2 Race Conditions......Page 749
16.3 Synchronization......Page 752
16.4 Creating a Multithreaded Method......Page 755
16.5 Thread Methods......Page 760
16.6 Thread Groups......Page 770
16.7 Multithreaded Graphics and Double Buffering......Page 772
16.8 Animating Images......Page 791
16.9 Timers......Page 796
16.10 Summary......Page 802
CHAPTER 17 NETWORK PROGRAMMING......Page 804
17.1 Implementing a Client......Page 805
17.2 Parsing Strings by Using StringTokenizer......Page 811
17.3 Example: A Client to Verify E-Mail Addresses......Page 814
17.4 Example: A Network Client That Retrieves URLs......Page 817
17.5 The URL Class......Page 822
17.6 WebClient: Talking to Web Servers Interactively......Page 826
17.7 Implementing a Server......Page 834
17.8 Example: A Simple HTTP Server......Page 840
17.9 RMI: Remote Method Invocation......Page 847
17.10 Summary......Page 871
PART 3 SERVER-SIDE PROGRAMMING......Page 873
18.1 How HTML Forms Transmit Data......Page 876
18.2 The FORM Element......Page 881
18.3 Text Controls......Page 886
18.4 Push Buttons......Page 891
18.5 Check Boxes and Radio Buttons......Page 897
18.6 Combo Boxes and List Boxes......Page 900
18.7 File Upload Controls......Page 903
18.8 Server-Side Image Maps......Page 905
18.9 Hidden Fields......Page 910
18.10 Grouping Controls......Page 911
18.11 Tab Order Control......Page 913
18.12 Summary......Page 914
CHAPTER 19 SERVER-SIDE JAVA: SERVLETS......Page 916
19.1 The Advantages of Servlets Over "Traditional" CGI......Page 917
19.2 Server Installation and Setup......Page 919
19.3 Basic Servlet Structure......Page 923
19.4 The Servlet Life Cycle......Page 930
19.5 An Example Using Initialization Parameters......Page 933
19.6 The Client Request: Form Data......Page 936
19.7 The Client Request: HTTP Request Headers......Page 941
19.8 The Servlet Equivalent of the Standard CGI Variables......Page 951
19.9 The Server Response: HTTP Status Codes......Page 954
19.10 The Server Response: HTTP Response Headers......Page 967
19.11 Cookies......Page 984
19.12 Session Tracking......Page 996
19.13 Summary......Page 1005
20.1 JSP Overview......Page 1008
20.2 Advantages of JSP......Page 1010
20.3 JSP Scripting Elements......Page 1011
20.4 The JSP page Directive......Page 1022
20.5 Including Files and Applets in JSP Documents......Page 1029
20.6 Using JavaBeans with JSP......Page 1042
20.7 Defining Custom JSP Tags......Page 1058
20.8 Integrating Servlets and JSP......Page 1092
20.9 Summary......Page 1105
CHAPTER 21 USING APPLETS AS FRONT ENDS TO SERVER-SIDE PROGRAMS......Page 1108
21.1 Sending Data with GET and Displaying the Resultant Page......Page 1109
21.2 A Multisystem Search Engine Front End......Page 1110
21.3 Using GET and Processing the Results Directly (HTTP Tunneling)......Page 1114
21.4 A Query Viewer That Uses Object Serialization and HTTP Tunneling......Page 1118
21.5 Using POST and Processing the Results Directly (HTTP Tunneling)......Page 1126
21.6 An Applet That Sends POST Data......Page 1129
21.8 Summary......Page 1134
CHAPTER 22 JDBC......Page 1136
22.1 Basic Steps in Using JDBC......Page 1137
22.2 Basic JDBC Example......Page 1141
22.3 Some JDBC Utilities......Page 1148
22.4 Applying the Database Utilities......Page 1157
22.5 An Interactive Query Viewer......Page 1163
22.6 Prepared Statements (Precompiled Queries)......Page 1170
22.7 Summary......Page 1174
CHAPTER 23 XML PROCESSING WITH JAVA......Page 1176
23.1 Parsing XML Documents with DOM Level 2......Page 1177
23.2 DOM Example: Representing an XML Document as a JTree......Page 1180
23.3 Parsing XML Documents with SAX 2.0......Page 1192
23.4 SAX Example 1: Printing the Outline of an XML Document......Page 1195
23.5 SAX Example 2: Counting Book Orders......Page 1201
23.6 Transforming XML with XSLT......Page 1207
23.7 XSLT Example 1: XSLT Document Editor......Page 1212
23.8 XSLT Example 2: Custom JSP Tag......Page 1222
23.9 Summary......Page 1230
PART 4 JAVASCRIPT......Page 1231
CHAPTER 24 JAVASCRIPT: ADDING DYNAMIC CONTENT TO WEB PAGES......Page 1234
24.1 Generating HTML Dynamically......Page 1236
24.2 Monitoring User Events......Page 1241
24.3 Mastering JavaScript Syntax......Page 1243
24.4 Using JavaScript to Customize Web Pages......Page 1252
24.5 Using JavaScript to Make Pages Dynamic......Page 1258
24.6 Using JavaScript to Validate HTML Forms......Page 1271
24.7 Using JavaScript to Store and Examine Cookies......Page 1280
24.8 Using JavaScript to Interact with Frames......Page 1285
24.9 Accessing Java from JavaScript......Page 1289
24.10 Accessing JavaScript from Java......Page 1299
24.11 Summary......Page 1315
25.1 The Array Object......Page 1318
25.2 The Button Object......Page 1322
25.3 The Checkbox Object......Page 1324
25.4 The Date Object......Page 1326
25.5 The Document Object......Page 1329
25.6 The Element Object......Page 1332
25.7 The FileUpload Object......Page 1334
25.8 The Form Object......Page 1336
25.9 The Function Object......Page 1337
25.11 The History Object......Page 1339
25.12 The Image Object......Page 1340
25.15 The Layer Object......Page 1343
25.16 The Link Object......Page 1347
25.17 The Location Object......Page 1349
25.18 The Math Object......Page 1350
25.19 The MimeType Object......Page 1353
25.20 The Navigator Object......Page 1354
25.21 The Number Object......Page 1357
25.22 The Object Object......Page 1360
25.23 The Option Object......Page 1362
25.24 The Password Object......Page 1363
25.25 The Plugin Object......Page 1365
25.26 The Radio Object......Page 1366
25.27 The RegExp Object......Page 1367
25.28 The Reset Object......Page 1372
25.29 The Screen Object......Page 1374
25.30 The Select Object......Page 1375
25.31 The String Object......Page 1378
25.32 The Submit Object......Page 1383
25.33 The Text Object......Page 1385
25.34 The Textarea Object......Page 1386
25.35 The Window Object......Page 1388
25.36 Summary......Page 1401
A......Page 1403
B......Page 1405
C......Page 1406
D......Page 1409
E......Page 1410
F......Page 1411
G......Page 1413
H......Page 1415
I......Page 1416
J......Page 1418
L......Page 1423
M......Page 1424
N......Page 1425
O......Page 1426
P......Page 1428
R......Page 1433
S......Page 1434
T......Page 1437
V......Page 1440
Z......Page 1441