Introduction |
|
xxxiii | |
Real Code for Real Programmers |
|
xxxiv | |
How This Book Is Organized |
|
xxxv | |
Conventions |
|
xxxviii | |
About the Web Site |
|
xxxix | |
About the Authors |
|
xxxix | |
Acknowledgments |
|
xli | |
PART 1 THE HYPERTEXT MARKUP LANGUAGE |
|
2 | (2) |
|
Designing Web Pages with HTML 4.0 |
|
|
4 | (1) |
|
The Hyper Text Markup Language |
|
|
5 | (2) |
|
HTML 4.0 and Other HTML Standards |
|
|
7 | (2) |
|
Steps to Publish a Document on the Web |
|
|
9 | (3) |
|
|
9 | (1) |
|
Put the Document on the Web |
|
|
10 | (2) |
|
|
12 | (1) |
|
The Basic Structure of HTML Documents |
|
|
12 | (4) |
|
|
13 | (1) |
|
|
14 | (2) |
|
HEAD---High-Level Information About the Page |
|
|
16 | (6) |
|
|
17 | (1) |
|
|
17 | (5) |
|
BODY---Creating the Main Document |
|
|
22 | (3) |
|
|
25 | (3) |
|
Block-Level Elements in HTML 4.0 |
|
|
28 | (30) |
|
|
30 | (2) |
|
|
32 | (3) |
|
|
32 | (2) |
|
Paragraphs with White Space Preserved |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
35 | (1) |
|
Numbered, Bulleted, and Indented Lists |
|
|
35 | (6) |
|
|
36 | (3) |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
41 | (13) |
|
The Basic Table Structure |
|
|
42 | (4) |
|
|
46 | (2) |
|
Table Headings and Data Cells |
|
|
48 | (2) |
|
|
50 | (4) |
|
|
54 | (1) |
|
Miscellaneous Block-Level Elements |
|
|
54 | (3) |
|
|
57 | (1) |
|
Text-Level Elements in HTML 4.0 |
|
|
58 | (30) |
|
Physical Character Styles |
|
|
59 | (5) |
|
|
64 | (3) |
|
Specifying Hypertext Links |
|
|
67 | (3) |
|
|
70 | (5) |
|
|
71 | (1) |
|
|
71 | (4) |
|
|
75 | (4) |
|
Embedding Other Objects in Documents |
|
|
79 | (7) |
|
|
80 | (2) |
|
Embedded Video, Audio, and Other Formats with Plug-ins |
|
|
82 | (1) |
|
Embedded ActiveX Controls |
|
|
83 | (2) |
|
Embedded Scrolling Text Banners |
|
|
85 | (1) |
|
|
86 | (1) |
|
|
87 | (1) |
|
|
88 | (26) |
|
|
90 | (1) |
|
|
91 | (5) |
|
Specifying the Content of Frame Cells |
|
|
96 | (4) |
|
|
98 | (2) |
|
|
100 | (3) |
|
|
103 | (1) |
|
Solving Common Frame Problems |
|
|
103 | (6) |
|
|
104 | (1) |
|
|
104 | (1) |
|
Updating Multiple Frame Cells Simultaneously |
|
|
105 | (3) |
|
Preventing Your Documents from Being Framed |
|
|
108 | (1) |
|
Creating Empty Frame Cells |
|
|
109 | (1) |
|
|
109 | (4) |
|
|
113 | (1) |
|
|
114 | (2) |
|
|
116 | (2) |
|
Using External and Local Style Sheets |
|
|
118 | (3) |
|
|
119 | (1) |
|
The STYLE Element and JavaScript Style Sheets |
|
|
120 | (1) |
|
Inline Style Specification |
|
|
121 | (1) |
|
|
121 | (4) |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
Cascading: Style Sheet Precedence Rules |
|
|
125 | (1) |
|
|
126 | (6) |
|
Foreground and Background Properties |
|
|
132 | (3) |
|
|
135 | (4) |
|
Properties of the Bounding Box |
|
|
139 | (4) |
|
|
140 | (1) |
|
|
141 | (1) |
|
|
142 | (1) |
|
Bounding Box Display Types |
|
|
143 | (1) |
|
Images and Floating Elements |
|
|
143 | (3) |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
148 | (9) |
|
Specifying Layers with the LAYER and ILAYER Elements |
|
|
149 | (4) |
|
Specifying Layers with Style Sheets |
|
|
153 | (4) |
|
|
157 | (1) |
PART 2 JAVA PROGRAMMING |
|
158 | (2) |
|
Getting Started with Java |
|
|
160 | (2) |
|
|
162 | (1) |
|
Java Is Web-Enabled and Network Savvy |
|
|
162 | (4) |
|
|
166 | (2) |
|
|
168 | (1) |
|
|
169 | (1) |
|
Java Is Rich with Powerful Standard Libraries |
|
|
170 | (1) |
|
|
171 | (4) |
|
|
172 | (1) |
|
|
172 | (2) |
|
|
174 | (1) |
|
Java Is Object Oriented (the One True Way of Programming) |
|
|
174 | (1) |
|
Java Is the Programming Language for All Software Development |
|
|
175 | (1) |
|
|
175 | (3) |
|
Which Version Should You Use? |
|
|
177 | (1) |
|
Whichever Version You Use |
|
|
177 | (1) |
|
Getting Started: Nuts and Bolts |
|
|
178 | (4) |
|
|
178 | (1) |
|
Install a Java-Enabled Browser |
|
|
179 | (1) |
|
Bookmark or Install the On-Line Java API |
|
|
180 | (1) |
|
Optional: Get an Integrated Development Environment |
|
|
180 | (1) |
|
Create and Run a Java Program |
|
|
181 | (1) |
|
Some Simple Java Programs |
|
|
182 | (5) |
|
The Basic Hello World Application |
|
|
182 | (1) |
|
|
183 | (1) |
|
The Basic Hello World (Wide Web) Applet |
|
|
183 | (2) |
|
Applet Customization Parameters |
|
|
185 | (2) |
|
|
187 | (3) |
|
Object-Oriented Programming in Java |
|
|
190 | (52) |
|
|
191 | (3) |
|
|
194 | (2) |
|
Constructors and the ``this'' Reference |
|
|
196 | (3) |
|
Static Initialization Blocks |
|
|
199 | (1) |
|
|
199 | (1) |
|
|
200 | (4) |
|
Public Version in Separate File |
|
|
204 | (5) |
|
|
209 | (7) |
|
|
211 | (2) |
|
Javadoc Command-Line Arguments |
|
|
213 | (3) |
|
|
216 | (5) |
|
Interfaces and Abstract Classes |
|
|
221 | (9) |
|
Packages, Classpath, and JAR Archives |
|
|
230 | (6) |
|
|
233 | (3) |
|
Modifiers in Declarations |
|
|
236 | (3) |
|
|
236 | (2) |
|
|
238 | (1) |
|
|
239 | (3) |
|
|
242 | (62) |
|
|
243 | (2) |
|
|
245 | (3) |
|
Primitive-Type Conversion |
|
|
247 | (1) |
|
Operators, Conditionals, Iteration |
|
|
248 | (11) |
|
|
248 | (1) |
|
|
249 | (6) |
|
|
255 | (4) |
|
|
259 | (4) |
|
|
259 | (1) |
|
|
259 | (2) |
|
|
261 | (1) |
|
BigInteger and BigDecimal |
|
|
261 | (2) |
|
|
263 | (3) |
|
Printing to Standard Output |
|
|
263 | (2) |
|
Printing to Standard Error |
|
|
265 | (1) |
|
Reading from Standard Input |
|
|
265 | (1) |
|
Execution of Non-Java Programs |
|
|
266 | (7) |
|
|
273 | (4) |
|
Java Argument-Passing Conventions |
|
|
275 | (1) |
|
|
275 | (2) |
|
|
277 | (7) |
|
|
278 | (6) |
|
|
284 | (1) |
|
|
284 | (4) |
|
Two-Step Array Allocation |
|
|
285 | (1) |
|
One-Step Array Allocation |
|
|
286 | (1) |
|
|
287 | (1) |
|
|
288 | (3) |
|
|
289 | (1) |
|
|
289 | (2) |
|
Example: A Simple Binary Tree |
|
|
291 | (5) |
|
|
296 | (7) |
|
|
296 | (3) |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
300 | (2) |
|
|
302 | (1) |
|
|
303 | (1) |
|
Applets and Basic Graphics |
|
|
304 | (54) |
|
|
305 | (1) |
|
|
306 | (3) |
|
|
307 | (1) |
|
|
307 | (2) |
|
|
309 | (3) |
|
|
311 | (1) |
|
Reloading Applets During Development |
|
|
311 | (1) |
|
|
312 | (2) |
|
|
314 | (6) |
|
|
320 | (2) |
|
Reading Applet Parameters |
|
|
322 | (4) |
|
Reading Applet Parameters: An Example |
|
|
323 | (3) |
|
|
326 | (2) |
|
|
328 | (3) |
|
|
331 | (1) |
|
|
332 | (5) |
|
|
333 | (3) |
|
|
336 | (1) |
|
|
336 | (1) |
|
Coordinates and Clipping Rectangles |
|
|
337 | (1) |
|
|
337 | (7) |
|
Loading Applet Images from Relative URLs |
|
|
338 | (2) |
|
Loading Applet Images from Absolute URLs |
|
|
340 | (2) |
|
Loading Images in Applications |
|
|
342 | (2) |
|
|
344 | (4) |
|
Controlling Image Loading: Waiting for Images and Checking Status |
|
|
348 | (7) |
|
|
355 | (3) |
|
Java 2D: Graphics in Java 2 |
|
|
358 | (40) |
|
Getting Started with Java 2D |
|
|
360 | (6) |
|
Useful Graphics2D Methods |
|
|
363 | (3) |
|
|
366 | (5) |
|
|
367 | (4) |
|
|
371 | (7) |
|
|
372 | (3) |
|
Tiled Images as Fill Patterns |
|
|
375 | (3) |
|
|
378 | (3) |
|
|
381 | (2) |
|
|
383 | (7) |
|
|
384 | (6) |
|
Coordinate Transformations |
|
|
390 | (4) |
|
|
393 | (1) |
|
Other Capabilities of Java 2D |
|
|
394 | (1) |
|
|
395 | (3) |
|
Handling Mouse and Keyboard Events |
|
|
398 | (28) |
|
Handling Events with a Separate Listener |
|
|
400 | (4) |
|
|
402 | (2) |
|
Handling Events by Implementing a Listener Interface |
|
|
404 | (2) |
|
Handling Events with Named Inner Classes |
|
|
406 | (1) |
|
Handling Events with Anonymous Inner Classes |
|
|
407 | (2) |
|
The Standard Events Listeners |
|
|
409 | (6) |
|
Behind the Scenes: Low-Level Event Processing |
|
|
415 | (3) |
|
A Spelling-Correcting Textfield |
|
|
418 | (3) |
|
|
421 | (4) |
|
|
423 | (2) |
|
|
425 | (1) |
|
|
426 | (40) |
|
|
428 | (2) |
|
FlowLayout Constructor Options |
|
|
429 | (1) |
|
|
429 | (1) |
|
|
430 | (3) |
|
BorderLayout Constructor Options |
|
|
432 | (1) |
|
Other BorderLayout Methods |
|
|
432 | (1) |
|
|
433 | (3) |
|
Gridlayout Constructor Options |
|
|
434 | (1) |
|
|
435 | (1) |
|
|
436 | (5) |
|
CardLayout Constructor Options |
|
|
440 | (1) |
|
|
440 | (1) |
|
|
441 | (8) |
|
The GridBagConstraints Object |
|
|
442 | (2) |
|
|
444 | (4) |
|
GridBagLayout Constructor Options |
|
|
448 | (1) |
|
Other GridBagLayout Methods |
|
|
448 | (1) |
|
|
449 | (5) |
|
BoxLayout Constructor Options |
|
|
452 | (1) |
|
|
453 | (1) |
|
Turning Off the Layout Manager |
|
|
454 | (1) |
|
Effective Use of Layout Managers |
|
|
455 | (9) |
|
|
456 | (3) |
|
Turn Off the Layout Manager for Some Containers |
|
|
459 | (2) |
|
Adjust the Empty Space Around Components |
|
|
461 | (3) |
|
|
464 | (2) |
|
|
466 | (96) |
|
|
468 | (4) |
|
Creating and Using a Canvas |
|
|
469 | (1) |
|
Example: A Circle Component |
|
|
469 | (3) |
|
|
472 | (7) |
|
Lightweight Components in Java 1.1 |
|
|
479 | (3) |
|
|
482 | (3) |
|
Default LayoutManager: FlowLayout |
|
|
482 | (1) |
|
Creating and Using a Panel |
|
|
483 | (1) |
|
Example: Using a Panel for Grouping |
|
|
483 | (2) |
|
|
485 | (2) |
|
|
487 | (1) |
|
|
487 | (2) |
|
Creating and Using a ScrollPane |
|
|
487 | (1) |
|
Example: ScrollPane with 100-Button Panel |
|
|
488 | (1) |
|
|
489 | (8) |
|
Default LayoutManager: BorderLayout |
|
|
489 | (1) |
|
Creating and Using a Frame |
|
|
490 | (1) |
|
|
491 | (1) |
|
|
492 | (1) |
|
|
493 | (2) |
|
Other Useful Frame Methods |
|
|
495 | (2) |
|
|
497 | (4) |
|
|
497 | (1) |
|
Reading a Window from Disk |
|
|
497 | (1) |
|
Example: A Saveable Frame |
|
|
498 | (3) |
|
|
501 | (3) |
|
Creating and Using a Dialog |
|
|
501 | (1) |
|
Example: A Quit Confirmation Dialog |
|
|
502 | (2) |
|
|
504 | (3) |
|
Example: Displaying Files in a TextArea |
|
|
504 | (3) |
|
|
507 | (1) |
|
Default LayoutManager: BorderLayout |
|
|
507 | (1) |
|
Creating and Using a Window |
|
|
507 | (1) |
|
Handling Events in GUI Controls |
|
|
508 | (4) |
|
Decentralized Event Processing |
|
|
509 | (2) |
|
Centralized Event Processing |
|
|
511 | (1) |
|
|
512 | (6) |
|
|
513 | (1) |
|
Example: Applet with Three Buttons |
|
|
513 | (1) |
|
|
514 | (1) |
|
|
515 | (3) |
|
|
518 | (3) |
|
|
519 | (1) |
|
Example: Checked Checkboxes |
|
|
519 | (1) |
|
|
520 | (1) |
|
|
521 | (1) |
|
Check Box Groups (Radio Buttons) |
|
|
521 | (3) |
|
|
522 | (1) |
|
Example: Check Boxes vs. Radio Buttons |
|
|
522 | (1) |
|
Other CheckboxGroup and Checkbox Methods |
|
|
523 | (1) |
|
Handling CheckboxGroup Events |
|
|
524 | (1) |
|
|
524 | (5) |
|
|
525 | (1) |
|
|
525 | (1) |
|
|
526 | (1) |
|
|
527 | (2) |
|
|
529 | (9) |
|
|
529 | (1) |
|
Example: Single and Multiple List Selections |
|
|
529 | (2) |
|
|
531 | (2) |
|
|
533 | (5) |
|
|
538 | (5) |
|
|
538 | (1) |
|
Example: Creating TextFields |
|
|
539 | (1) |
|
|
539 | (3) |
|
Handling TextField Events |
|
|
542 | (1) |
|
|
543 | (2) |
|
|
543 | (1) |
|
Example: Empty and Filled Text Areas |
|
|
544 | (1) |
|
|
544 | (1) |
|
|
545 | (1) |
|
|
545 | (5) |
|
|
546 | (1) |
|
Example: Four Different Labels |
|
|
546 | (1) |
|
|
547 | (1) |
|
|
548 | (2) |
|
|
550 | (6) |
|
|
550 | (1) |
|
Example: Variety of Sliders |
|
|
551 | (1) |
|
|
552 | (2) |
|
Handling Scrollbar Events |
|
|
554 | (2) |
|
|
556 | (4) |
|
|
556 | (1) |
|
Example: Applet Pop-up Menu |
|
|
556 | (2) |
|
|
558 | (1) |
|
Handling PopupMenu Events |
|
|
559 | (1) |
|
|
560 | (2) |
|
|
562 | (66) |
|
Getting Started with Swing |
|
|
564 | (8) |
|
Differences Between Swing and the AWT |
|
|
564 | (8) |
|
|
572 | (2) |
|
|
574 | (2) |
|
|
576 | (5) |
|
New Features: Images, Borders, and HTML Content |
|
|
576 | (1) |
|
|
577 | (1) |
|
|
578 | (3) |
|
|
581 | (4) |
|
New Features: Icons, Alignment, and Mnemonics |
|
|
581 | (1) |
|
|
582 | (1) |
|
|
582 | (1) |
|
Useful JButton (AbstractButton) Methods |
|
|
582 | (3) |
|
|
585 | (5) |
|
|
585 | (1) |
|
|
585 | (1) |
|
Useful BorderFactory Methods |
|
|
586 | (4) |
|
|
590 | (4) |
|
New Features: Tick Marks and Labels |
|
|
590 | (1) |
|
|
590 | (1) |
|
|
591 | (3) |
|
The JColorChooser Component |
|
|
594 | (4) |
|
|
595 | (1) |
|
Useful JColorChooser Methods |
|
|
595 | (3) |
|
|
598 | (4) |
|
JInternalFrame Constructors |
|
|
598 | (1) |
|
Useful JInternalFrame Methods |
|
|
598 | (4) |
|
The JOptionPane Component |
|
|
602 | (5) |
|
Useful JOptionPane Methods |
|
|
602 | (5) |
|
|
607 | (7) |
|
|
609 | (1) |
|
|
609 | (5) |
|
The JEditorPane Component |
|
|
614 | (8) |
|
Following Hypertext Links |
|
|
615 | (1) |
|
|
616 | (1) |
|
Useful JEditorPane Methods |
|
|
616 | (2) |
|
Implementing a Simple Web Browser |
|
|
618 | (3) |
|
HTML Support and JavaHelp |
|
|
621 | (1) |
|
Other Simple Swing Components |
|
|
622 | (4) |
|
|
622 | (1) |
|
The JRadioButton Component |
|
|
623 | (2) |
|
|
625 | (1) |
|
|
625 | (1) |
|
The JFileChooser Component |
|
|
625 | (1) |
|
|
626 | (2) |
|
|
628 | (70) |
|
Using Custom Data Models and Renderers |
|
|
630 | (1) |
|
|
631 | (19) |
|
JList with a Fixed Set of Choices |
|
|
631 | (5) |
|
JLists with Changeable Choices |
|
|
636 | (3) |
|
JList with Custom Data Model |
|
|
639 | (7) |
|
JList with Custom Renderer |
|
|
646 | (4) |
|
|
650 | (14) |
|
|
650 | (4) |
|
|
654 | (10) |
|
|
664 | (16) |
|
|
664 | (5) |
|
|
669 | (5) |
|
|
674 | (2) |
|
|
676 | (4) |
|
|
680 | (11) |
|
|
681 | (2) |
|
The Role of Double Buffering |
|
|
683 | (1) |
|
A General-Purpose Component-Printing Routine |
|
|
684 | (5) |
|
|
689 | (2) |
|
|
691 | (5) |
|
|
693 | (3) |
|
|
696 | (2) |
|
Concurrent Programming with Java Threads |
|
|
698 | (62) |
|
|
700 | (6) |
|
Mechanism 1: Put Behavior in a Separate Thread Object |
|
|
700 | (3) |
|
Mechanism 2: Put Behavior in the Driver Class, Which Must Implement Runnable |
|
|
703 | (3) |
|
|
706 | (3) |
|
|
709 | (3) |
|
Synchronizing a Section of Code |
|
|
709 | (1) |
|
Synchronizing an Entire Method |
|
|
710 | (1) |
|
Common Synchronization Bug |
|
|
710 | (2) |
|
Creating a Multithreaded Method |
|
|
712 | (5) |
|
|
717 | (10) |
|
|
718 | (1) |
|
|
719 | (1) |
|
|
719 | (6) |
|
|
725 | (2) |
|
|
727 | (2) |
|
|
727 | (1) |
|
|
727 | (2) |
|
Multithreaded Graphics and Double Buffering |
|
|
729 | (19) |
|
Redraw Everything in paint |
|
|
730 | (4) |
|
Implement the Dynamic Part as a Separate Component |
|
|
734 | (1) |
|
Have Routines Other Than paint Draw Directly |
|
|
735 | (2) |
|
Override update and Have paint Do Incremental Updating |
|
|
737 | (6) |
|
|
743 | (5) |
|
|
748 | (5) |
|
|
753 | (6) |
|
|
757 | (1) |
|
|
757 | (2) |
|
|
759 | (1) |
|
|
760 | (70) |
|
|
762 | (6) |
|
Example: A Genetic Network Client |
|
|
765 | (3) |
|
Parsing Strings by Using String Tokenizer |
|
|
768 | (3) |
|
The String Tokenizer Class |
|
|
768 | (1) |
|
|
769 | (1) |
|
|
769 | (1) |
|
Example: Interactive Tokenizer |
|
|
770 | (1) |
|
Example: A Client to Verify E-Mail Addresses |
|
|
771 | (3) |
|
Example: A Network Client That Retrieves URLs |
|
|
774 | (5) |
|
A Class to Retrieve a Given URI from a Given Host |
|
|
775 | (2) |
|
A Class to Retrieve a Given URL |
|
|
777 | (1) |
|
|
778 | (1) |
|
|
779 | (4) |
|
|
779 | (2) |
|
Other Useful Methods of the URL Class |
|
|
781 | (2) |
|
WebClient: Talking to Web Servers Interactively |
|
|
783 | (8) |
|
|
791 | (6) |
|
Example: A Genetic Network Server |
|
|
793 | (4) |
|
Connecting Network Client and NetworkServer |
|
|
797 | (1) |
|
Example: A Simple HTTP Server |
|
|
797 | (7) |
|
ThreadedEchoServer: Adding Multithreading |
|
|
802 | (2) |
|
RMI: Remote Method Invocation |
|
|
804 | (24) |
|
Steps to Build an RMI Application |
|
|
805 | (1) |
|
|
806 | (5) |
|
A Realistic Example: A Server for Numeric Integration |
|
|
811 | (2) |
|
A Realistic Example of the Four Required Classes |
|
|
813 | (4) |
|
Compiling and Running the System for the Realistic Example |
|
|
817 | (2) |
|
Enterprise RMI Configuration |
|
|
819 | (3) |
|
Compiling and Running the System for an Enterprise RMI Configuration |
|
|
822 | (3) |
|
|
825 | (3) |
|
|
828 | (2) |
PART 3 SERVER-SIDE PROGRAMMING |
|
830 | (358) |
|
|
832 | (40) |
|
How HTML Forms Transmit Data |
|
|
833 | (5) |
|
|
838 | (5) |
|
|
843 | (5) |
|
|
843 | (2) |
|
|
845 | (1) |
|
|
846 | (2) |
|
|
848 | (6) |
|
|
849 | (3) |
|
|
852 | (1) |
|
|
853 | (1) |
|
Check Boxes and Radio Buttons |
|
|
854 | (3) |
|
|
854 | (1) |
|
|
855 | (2) |
|
Combo Boxes and List Boxes |
|
|
857 | (3) |
|
|
860 | (2) |
|
|
862 | (5) |
|
IMAGE---Standard Server-Side Image Maps |
|
|
863 | (2) |
|
ISMAP---Alternative Server-Side Image Maps |
|
|
865 | (2) |
|
|
867 | (1) |
|
|
868 | (2) |
|
|
870 | (1) |
|
|
871 | (1) |
|
Server-Side Java: Servlets |
|
|
872 | (92) |
|
The Advantages of Servlets Over ``Traditional'' CGI |
|
|
874 | (2) |
|
|
874 | (1) |
|
|
875 | (1) |
|
|
875 | (1) |
|
|
875 | (1) |
|
|
876 | (1) |
|
|
876 | (1) |
|
Server Installation and Setup |
|
|
876 | (4) |
|
Obtain Servlet and JSP Software |
|
|
877 | (1) |
|
Bookmark or Install the Servlet and JSP API Documentation |
|
|
878 | (1) |
|
Identify the Classes to the Java Compiler |
|
|
878 | (1) |
|
|
879 | (1) |
|
|
879 | (1) |
|
Compile and Install Your Servlets |
|
|
879 | (1) |
|
|
880 | (1) |
|
|
880 | (7) |
|
A Servlet That Generates Plain Text |
|
|
882 | (1) |
|
A Servlet That Generates HTML |
|
|
883 | (2) |
|
Simple HTML-Building Utilities |
|
|
885 | (2) |
|
|
887 | (3) |
|
|
887 | (1) |
|
|
888 | (1) |
|
The doGet, doPost, and doXxx Methods |
|
|
889 | (1) |
|
The Single ThreadModel Interface |
|
|
889 | (1) |
|
|
890 | (1) |
|
An Example Using Initialization Parameters |
|
|
890 | (3) |
|
The Client Request: Form Data |
|
|
893 | (5) |
|
Reading Form Data from CGI Programs |
|
|
893 | (1) |
|
Reading Form Data from Servlets |
|
|
894 | (1) |
|
Example: Reading Three Explicit Parameters |
|
|
894 | (3) |
|
|
897 | (1) |
|
The Client Request: HTTP Request Headers |
|
|
898 | (10) |
|
Reading Request Headers from Servlets |
|
|
899 | (1) |
|
Example: Making a Table of All Request Headers |
|
|
900 | (3) |
|
|
903 | (3) |
|
Sending Compressed Web Pages |
|
|
906 | (2) |
|
The Servlet Equivalent of the Standard CGI Variables |
|
|
908 | (3) |
|
The Server Response: HTTP Status Codes |
|
|
911 | (13) |
|
|
912 | (1) |
|
|
913 | (6) |
|
A Front End to Various Search Engines |
|
|
919 | (5) |
|
The Server Response: HTTP Response Headers |
|
|
924 | (17) |
|
Setting Response Headers from Servlets |
|
|
924 | (2) |
|
HTTP 1.1 Response Headers |
|
|
926 | (6) |
|
Persistent Servlet State and Auto-Reloading Pages |
|
|
932 | (9) |
|
|
941 | (12) |
|
|
942 | (1) |
|
Some Problems with Cookies |
|
|
943 | (1) |
|
|
944 | (3) |
|
Examples of Setting and Reading Cookies |
|
|
947 | (4) |
|
|
951 | (1) |
|
Finding Cookies with Specified Names |
|
|
951 | (2) |
|
Creating Long-Lived Cookies |
|
|
953 | (1) |
|
|
953 | (9) |
|
The Need for Session Tracking |
|
|
953 | (2) |
|
|
955 | (4) |
|
|
959 | (1) |
|
A Servlet Showing Per-Client Access Counts |
|
|
960 | (2) |
|
|
962 | (2) |
|
|
964 | (100) |
|
|
965 | (2) |
|
|
967 | (1) |
|
Versus Active Server Pages (ASP) or ColdFusion |
|
|
967 | (1) |
|
|
967 | (1) |
|
|
967 | (1) |
|
Versus Server-Side Includes (SSI) |
|
|
968 | (1) |
|
|
968 | (1) |
|
|
968 | (11) |
|
|
969 | (3) |
|
|
972 | (3) |
|
|
975 | (2) |
|
|
977 | (2) |
|
|
979 | (7) |
|
|
979 | (3) |
|
The content Type Attribute |
|
|
982 | (1) |
|
The is ThreadSafe Attribute |
|
|
983 | (1) |
|
|
984 | (1) |
|
|
984 | (1) |
|
|
984 | (1) |
|
|
985 | (1) |
|
|
985 | (1) |
|
|
985 | (1) |
|
The isErrorPage Attribute |
|
|
985 | (1) |
|
|
985 | (1) |
|
XML Syntax for Directives |
|
|
986 | (1) |
|
Including Files and Applets in JSP Documents |
|
|
986 | (13) |
|
The include Directive: Including Files at Page Translation Time |
|
|
987 | (2) |
|
Including Files at Request Time |
|
|
989 | (3) |
|
Including Applets for the Java Plug-In |
|
|
992 | (3) |
|
|
995 | (4) |
|
|
999 | (16) |
|
|
1001 | (2) |
|
|
1003 | (2) |
|
|
1005 | (6) |
|
|
1011 | (4) |
|
|
1015 | (34) |
|
The Components That Make Up a Tag Library |
|
|
1015 | (4) |
|
|
1019 | (3) |
|
Assigning Attributes to Tags |
|
|
1022 | (4) |
|
|
1026 | (5) |
|
Optionally Including the Tag Body |
|
|
1031 | (3) |
|
Manipulating the Tag Body |
|
|
1034 | (4) |
|
Including or Manipulating the Tag Body Multiple Times |
|
|
1038 | (4) |
|
|
1042 | (7) |
|
Integrating Servlets and JSP |
|
|
1049 | (13) |
|
|
1049 | (4) |
|
Example: An On-Line Travel Agent |
|
|
1053 | (9) |
|
Forwarding Requests From JSP Pages |
|
|
1062 | (1) |
|
|
1062 | (2) |
|
Using Applets as Front Ends to Server-Side Programs |
|
|
1064 | (28) |
|
Sending Data with GET and Displaying the Resultant Page |
|
|
1066 | (1) |
|
A Multisystem Search Engine Front End |
|
|
1067 | (4) |
|
Using GET and Processing the Results Directly (HTTP Tunneling) |
|
|
1071 | (4) |
|
Reading Binary or ASCII Data |
|
|
1072 | (1) |
|
Reading Serialized Data Structures |
|
|
1073 | (2) |
|
A Query Viewer That Uses Object Serialization and HTTP Tunneling |
|
|
1075 | (8) |
|
Using POST and Processing the Results Directly (HTTP Tunneling) |
|
|
1083 | (3) |
|
An Applet That Sends POST Data |
|
|
1086 | (5) |
|
Bypassing the HTTP Server |
|
|
1091 | (1) |
|
|
1091 | (1) |
|
|
1092 | (40) |
|
Basic Steps in Using JDBC |
|
|
1094 | (4) |
|
|
1094 | (1) |
|
Define the Connection URL |
|
|
1095 | (1) |
|
|
1096 | (1) |
|
|
1096 | (1) |
|
|
1097 | (1) |
|
|
1097 | (1) |
|
|
1098 | (1) |
|
|
1098 | (7) |
|
|
1105 | (9) |
|
Applying the Database Utilities |
|
|
1114 | (6) |
|
An Interactive Query Viewer |
|
|
1120 | (7) |
|
|
1122 | (5) |
|
Prepared Statements (Precompiled Queries) |
|
|
1127 | (4) |
|
|
1131 | (1) |
|
|
1132 | (56) |
|
Parsing XML Documents with DOM Level 2 |
|
|
1134 | (3) |
|
|
1134 | (1) |
|
|
1135 | (2) |
|
DOM Example: Representing an XML Document as a JTree |
|
|
1137 | (12) |
|
Parsing XML Documents with SAX 2.0 |
|
|
1149 | (3) |
|
|
1149 | (1) |
|
|
1150 | (2) |
|
SAX Example 1: Printing the Outline of an XML Document |
|
|
1152 | (6) |
|
SAX Example 2: Counting Book Orders |
|
|
1158 | (6) |
|
Transforming XML with XSLT |
|
|
1164 | (5) |
|
|
1164 | (1) |
|
|
1165 | (4) |
|
XSLT Example 1: XSLT Document Editor |
|
|
1169 | (10) |
|
XSLT Example 2: Custom JSP Tag |
|
|
1179 | (8) |
|
|
1187 | (1) |
PART 4 JAVASCRIPT |
|
1188 | (172) |
|
Javascript: Adding Dynamic Content to Web Pages |
|
|
1190 | (84) |
|
Generating HTML Dynamically |
|
|
1193 | (5) |
|
Compatibility with Multiple Browsers |
|
|
1197 | (1) |
|
|
1198 | (2) |
|
Mastering JavaScript Syntax |
|
|
1200 | (9) |
|
|
1201 | (1) |
|
|
1201 | (1) |
|
|
1202 | (6) |
|
|
1208 | (1) |
|
Using JavaScript to Customize Web Pages |
|
|
1209 | (6) |
|
Adjusting to the Browser Window Size |
|
|
1209 | (4) |
|
Determining Whether Plug-Ins Are Available |
|
|
1213 | (2) |
|
Using JavaScript to Make Pages Dynamic |
|
|
1215 | (13) |
|
Modifying Images Dynamically |
|
|
1215 | (8) |
|
|
1223 | (5) |
|
Using JavaScript to Validate HTML Forms |
|
|
1228 | (9) |
|
Checking Values Individually |
|
|
1229 | (2) |
|
Checking Values When Form Is Submitted |
|
|
1231 | (6) |
|
Using JavaScript to Store and Examine Cookies |
|
|
1237 | (5) |
|
Using JavaScript to Interact with Frames |
|
|
1242 | (4) |
|
Directing a Particular Frame to Display a URL |
|
|
1242 | (4) |
|
Giving a Frame the Input Focus |
|
|
1246 | (1) |
|
Accessing Java from JavaScript |
|
|
1246 | (10) |
|
Calling Java Methods Directly |
|
|
1247 | (1) |
|
Using Applets to Perform Operations for JavaScript |
|
|
1248 | (4) |
|
Controlling Applets from JavaScript |
|
|
1252 | (4) |
|
Accessing JavaScript from Java |
|
|
1256 | (16) |
|
Example: Matching Applet Background with Web Page |
|
|
1259 | (1) |
|
Example: An Applet That Controls HTML Form Values |
|
|
1260 | (11) |
|
Methods in the JSObject Class |
|
|
1271 | (1) |
|
|
1272 | (2) |
|
Javascript Quick Reference |
|
|
1274 | (86) |
|
|
1275 | (4) |
|
|
1275 | (1) |
|
|
1276 | (1) |
|
|
1276 | (3) |
|
|
1279 | (1) |
|
|
1279 | (2) |
|
|
1279 | (1) |
|
|
1280 | (1) |
|
|
1280 | (1) |
|
|
1281 | (2) |
|
|
1281 | (1) |
|
|
1282 | (1) |
|
|
1282 | (1) |
|
|
1283 | (3) |
|
|
1283 | (1) |
|
|
1283 | (1) |
|
|
1283 | (3) |
|
|
1286 | (1) |
|
|
1286 | (3) |
|
|
1286 | (2) |
|
|
1288 | (1) |
|
|
1289 | (1) |
|
|
1289 | (2) |
|
|
1289 | (1) |
|
|
1290 | (1) |
|
|
1291 | (1) |
|
|
1291 | (2) |
|
|
1292 | (1) |
|
|
1292 | (1) |
|
|
1292 | (1) |
|
|
1293 | (1) |
|
|
1293 | (1) |
|
|
1293 | (1) |
|
|
1294 | (1) |
|
|
1294 | (2) |
|
|
1294 | (1) |
|
|
1295 | (1) |
|
|
1295 | (1) |
|
|
1295 | (1) |
|
|
1296 | (1) |
|
|
1296 | (1) |
|
|
1296 | (1) |
|
|
1296 | (1) |
|
|
1296 | (1) |
|
|
1297 | (1) |
|
|
1297 | (1) |
|
|
1297 | (1) |
|
|
1297 | (3) |
|
|
1298 | (1) |
|
|
1298 | (1) |
|
|
1299 | (1) |
|
|
1299 | (1) |
|
|
1300 | (1) |
|
|
1300 | (1) |
|
|
1300 | (4) |
|
|
1300 | (1) |
|
|
1301 | (1) |
|
|
1302 | (1) |
|
|
1303 | (1) |
|
|
1304 | (2) |
|
|
1304 | (1) |
|
|
1305 | (1) |
|
|
1305 | (1) |
|
|
1306 | (1) |
|
|
1306 | (1) |
|
|
1307 | (1) |
|
|
1307 | (1) |
|
|
1307 | (3) |
|
|
1307 | (1) |
|
|
1308 | (2) |
|
|
1310 | (1) |
|
|
1310 | (1) |
|
|
1311 | (1) |
|
|
1311 | (1) |
|
|
1311 | (1) |
|
|
1311 | (3) |
|
|
1311 | (3) |
|
|
1314 | (1) |
|
|
1314 | (1) |
|
|
1314 | (3) |
|
|
1315 | (1) |
|
|
1315 | (1) |
|
|
1315 | (2) |
|
|
1317 | (1) |
|
|
1317 | (2) |
|
|
1318 | (1) |
|
|
1318 | (1) |
|
|
1318 | (1) |
|
|
1319 | (1) |
|
|
1319 | (1) |
|
|
1319 | (1) |
|
|
1319 | (1) |
|
|
1320 | (1) |
|
|
1320 | (1) |
|
|
1320 | (2) |
|
|
1320 | (1) |
|
|
1321 | (1) |
|
|
1321 | (1) |
|
|
1322 | (1) |
|
|
1322 | (1) |
|
|
1322 | (1) |
|
|
1322 | (1) |
|
|
1323 | (1) |
|
|
1323 | (1) |
|
|
1323 | (1) |
|
|
1324 | (1) |
|
|
1324 | (5) |
|
|
1324 | (2) |
|
|
1326 | (1) |
|
|
1327 | (1) |
|
|
1328 | (1) |
|
Special Patterns in Regular Expressions |
|
|
1328 | (1) |
|
|
1329 | (2) |
|
|
1330 | (1) |
|
|
1330 | (1) |
|
|
1330 | (1) |
|
|
1331 | (1) |
|
|
1331 | (1) |
|
|
1332 | (1) |
|
|
1332 | (1) |
|
|
1332 | (3) |
|
|
1333 | (1) |
|
|
1334 | (1) |
|
|
1334 | (1) |
|
|
1335 | (5) |
|
|
1335 | (1) |
|
|
1335 | (1) |
|
|
1335 | (5) |
|
|
1340 | (1) |
|
|
1340 | (2) |
|
|
1340 | (1) |
|
|
1341 | (1) |
|
|
1341 | (1) |
|
|
1342 | (1) |
|
|
1342 | (1) |
|
|
1342 | (1) |
|
|
1343 | (1) |
|
|
1343 | (2) |
|
|
1344 | (1) |
|
|
1344 | (1) |
|
|
1344 | (1) |
|
|
1345 | (13) |
|
|
1345 | (4) |
|
|
1349 | (5) |
|
|
1354 | (1) |
|
An Example of the open Method |
|
|
1355 | (3) |
|
|
1358 | (2) |
Index |
|
1360 | |