9780130897930

Core Web Programming

by ;
  • ISBN13:

    9780130897930

  • ISBN10:

    0130897930

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2001-05-24
  • Publisher: Prentice Hall

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $59.99 Save up to $36.75
  • Rent Book $23.24
    Add to Cart Free Shipping

    TERM
    PRICE
    DUE
    HURRY! ONLY 1 COPY IN STOCK AT THIS PRICE

Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The Used and Rental copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Summary

One-stop shopping for serious Web developers! The worldwide best seller for serious Web developers-now 100% updated! In-depth HTML 4/CSS, Java 2, Servlets, JSP, XML, and more! Industrial-strength code examples throughout! The authoritative guide to every technology that enterprise Web developers need to master, from HTML 4 to Java 2 Standard Edition 1.3, servlets to JavaServer Pages, and beyond. Core Web Programming, Second Edition brings them all together in the ultimate Web development resource for experienced programmers.HTML 4: In-depth, practical coverage of HTML document structure, block-level and text-level elements, frames, cascading style sheets, and beyond. Java 2: Basic syntax, object-oriented design, applets and animation, the Java Plug-In, user interface development with Swing, layout managers, Java2D, multithreading, network programming, database connectivity, and more.Server-Side Java: Servlets, JSP, XML, and JDBC-the foundations of enterprisedevelopment with Java. Advanced topics include JSP custom tag libraries,combining servlets and JSP (MVC), database connection pooling, SAX, DOM, and XSLT processing, and detailed coverage of HTTP 1.1.JavaScript: Dynamic creation of Web page content, user event monitoring, HTML form field validation, and more. Includes a complete quick reference guide.This book's first edition is used in leading computer science programs worldwide, from MIT to Stanford, UC Berkeley to Princeton, UCLA to Johns Hopkins. Now, it's been 100% updated for today's hottest Web development technologies-with powerful new techniques, each with complete working code examples!Every Core Series book: DEMONSTRATES practical techniques used by professional developers FEATURES robust, thoroughly tested sample code and realistic examples FOCUSES on the cutting-edge technologies you need to master today PROVIDES expert advice that will help you build superior software Core Web Programming delivers: Practical insights for Web development with HTML, CSS, and JavaScript Expert J2SE 1.3 coverage, from Swing and Java 2D to threading, RMI, and JDBC Fast-track techniques for server-side development with servlets, JSP, and XML Hundreds of real-world code examples, including complete sample applications

Author Biography

MARTY HALL is the author of Core Servlets and JavaServer Pages, the world's most popular book on servlet and JSP technology. He is a Senior Computer Scientist at the Johns Hopkins University Applied Physics Laboratory.

LARRY BROWN is a Senior Network Engineer at the Naval Sea Systems Command, Carderock Division. He is also a Computer Science faculty member at the Johns Hopkins University, where he teaches server-side programming, distributed Web programming, and Java user interface development for the part-time graduate program in Computer Science.

Table of Contents

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)
Create the Document
9(1)
Put the Document on the Web
10(2)
Validate the Document
12(1)
The Basic Structure of HTML Documents
12(4)
HTML Document Template
13(1)
DOCTYPE Declarations
14(2)
HEAD---High-Level Information About the Page
16(6)
Required HEAD Element
17(1)
Optional HEAD Elements
17(5)
BODY---Creating the Main Document
22(3)
Summary
25(3)
Block-Level Elements in HTML 4.0
28(30)
Headings
30(2)
Basic Text Elements
32(3)
Basic Paragraphs
32(2)
Paragraphs with White Space Preserved
34(1)
Indented Quotations
35(1)
Addresses
35(1)
Numbered, Bulleted, and Indented Lists
35(6)
Numbered Lists
36(3)
Bulleted Lists
39(1)
Definition Lists
40(1)
Tables
41(13)
The Basic Table Structure
42(4)
Defining Table Rows
46(2)
Table Headings and Data Cells
48(2)
Grouping Table Contents
50(4)
Fill-Out Forms
54(1)
Miscellaneous Block-Level Elements
54(3)
Summary
57(1)
Text-Level Elements in HTML 4.0
58(30)
Physical Character Styles
59(5)
Logical Character Styles
64(3)
Specifying Hypertext Links
67(3)
Embedded Images
70(5)
Animated GIFs
71(1)
The IMG Element
71(4)
Client-Side Image Maps
75(4)
Embedding Other Objects in Documents
79(7)
Embedded Applets
80(2)
Embedded Video, Audio, and Other Formats with Plug-ins
82(1)
Embedded ActiveX Controls
83(2)
Embedded Scrolling Text Banners
85(1)
Controlling Line Breaks
86(1)
Summary
87(1)
Frames
88(26)
Frame Document Template
90(1)
Specifying Frame Layout
91(5)
Specifying the Content of Frame Cells
96(4)
Examples
98(2)
Targeting Frame Cells
100(3)
Predefined Frame Names
103(1)
Solving Common Frame Problems
103(6)
Bookmarking Frames
104(1)
Printing Frames
104(1)
Updating Multiple Frame Cells Simultaneously
105(3)
Preventing Your Documents from Being Framed
108(1)
Creating Empty Frame Cells
109(1)
Inline Frames
109(4)
Summary
113(1)
Cascading Style Sheets
114(2)
Specifying Style Rules
116(2)
Using External and Local Style Sheets
118(3)
External Style Sheets
119(1)
The STYLE Element and JavaScript Style Sheets
120(1)
Inline Style Specification
121(1)
Selectors
121(4)
HTML Elements
122(1)
User-Defined Classes
123(1)
User-Defined IDs
124(1)
Anchor Pseudoclasses
124(1)
Cascading: Style Sheet Precedence Rules
125(1)
Font Properties
126(6)
Foreground and Background Properties
132(3)
Text Properties
135(4)
Properties of the Bounding Box
139(4)
Margins
140(1)
Borders
141(1)
Padding
142(1)
Bounding Box Display Types
143(1)
Images and Floating Elements
143(3)
List Properties
146(1)
Standard Property Units
147(1)
Lengths
147(1)
Colors
147(1)
Layers
148(9)
Specifying Layers with the LAYER and ILAYER Elements
149(4)
Specifying Layers with Style Sheets
153(4)
Summary
157(1)
PART 2 JAVA PROGRAMMING 158(2)
Getting Started with Java
160(2)
Unique Features of Java
162(1)
Java Is Web-Enabled and Network Savvy
162(4)
Java Is Cross-Platform
166(2)
Java Is Simple
168(1)
Java Is Object Oriented
169(1)
Java Is Rich with Powerful Standard Libraries
170(1)
Myths About Java
171(4)
Java Is Only for the Web
172(1)
Java Is Cross-Platform
172(2)
Java Is Simple
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)
Java Versions
175(3)
Which Version Should You Use?
177(1)
Whichever Version You Use
177(1)
Getting Started: Nuts and Bolts
178(4)
Install Java
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)
Command-Line Arguments
183(1)
The Basic Hello World (Wide Web) Applet
183(2)
Applet Customization Parameters
185(2)
Summary
187(3)
Object-Oriented Programming in Java
190(52)
Instance Variables
191(3)
Methods
194(2)
Constructors and the ``this'' Reference
196(3)
Static Initialization Blocks
199(1)
Destructors
199(1)
Overloading
200(4)
Public Version in Separate File
204(5)
Javadoc
209(7)
Javadoc Tags
211(2)
Javadoc Command-Line Arguments
213(3)
Inheritance
216(5)
Interfaces and Abstract Classes
221(9)
Packages, Classpath, and JAR Archives
230(6)
The CLASSPATH
233(3)
Modifiers in Declarations
236(3)
Visibility Modifiers
236(2)
Other Modifiers
238(1)
Summary
239(3)
Basic Java Syntax
242(62)
Rules of Syntax
243(2)
Primitive Types
245(3)
Primitive-Type Conversion
247(1)
Operators, Conditionals, Iteration
248(11)
Arithmetic Operators
248(1)
Conditionals
249(6)
Loops
255(4)
The Math Class
259(4)
Constants
259(1)
General-Purpose Methods
259(2)
Trigonometric Methods
261(1)
BigInteger and BigDecimal
261(2)
Input and Output
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)
Reference Types
273(4)
Java Argument-Passing Conventions
275(1)
The instanceof Operator
275(2)
Strings
277(7)
String Methods
278(6)
Constructors
284(1)
Arrays
284(4)
Two-Step Array Allocation
285(1)
One-Step Array Allocation
286(1)
Multidimensional Arrays
287(1)
Vectors
288(3)
Constructors
289(1)
Methods
289(2)
Example: A Simple Binary Tree
291(5)
Exceptions
296(7)
Basic Form
296(3)
Multiple Catch Clauses
299(1)
The Finally Clause
300(1)
Thrown Exceptions
300(2)
Unchecked Exceptions
302(1)
Summary
303(1)
Applets and Basic Graphics
304(54)
What Are Applets?
305(1)
Creating an Applet
306(3)
Template for Applets
307(1)
Template for HTML
307(2)
An Example Applet
309(3)
Redrawing Automatically
311(1)
Reloading Applets During Development
311(1)
The Applet Life Cycle
312(2)
Other Applet Methods
314(6)
The HTML APPLET Element
320(2)
Reading Applet Parameters
322(4)
Reading Applet Parameters: An Example
323(3)
HTML OBJECT Element
326(2)
The Java Plug-In
328(3)
Graphical Applications
331(1)
Graphics Operations
332(5)
Drawing Operations
333(3)
Colors and Fonts
336(1)
Drawing Modes
336(1)
Coordinates and Clipping Rectangles
337(1)
Drawing Images
337(7)
Loading Applet Images from Relative URLs
338(2)
Loading Applet Images from Absolute URLs
340(2)
Loading Images in Applications
342(2)
Preloading Images
344(4)
Controlling Image Loading: Waiting for Images and Checking Status
348(7)
Summary
355(3)
Java 2D: Graphics in Java 2
358(40)
Getting Started with Java 2D
360(6)
Useful Graphics2D Methods
363(3)
Drawing Shapes
366(5)
Shape Classes
367(4)
Paint Styles
371(7)
Paint Classes
372(3)
Tiled Images as Fill Patterns
375(3)
Transparent Drawing
378(3)
Using Local Fonts
381(2)
Stroke Styles
383(7)
Stroke Attributes
384(6)
Coordinate Transformations
390(4)
Shear Transformations
393(1)
Other Capabilities of Java 2D
394(1)
Summary
395(3)
Handling Mouse and Keyboard Events
398(28)
Handling Events with a Separate Listener
400(4)
Drawing Circles
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)
A Whiteboard Class
421(4)
A Better Whiteboard
423(2)
Summary
425(1)
Layout Managers
426(40)
The FlowLayout Manager
428(2)
FlowLayout Constructor Options
429(1)
Other FlowLayout Methods
429(1)
The BorderLayout Manager
430(3)
BorderLayout Constructor Options
432(1)
Other BorderLayout Methods
432(1)
The GridLayout Manager
433(3)
Gridlayout Constructor Options
434(1)
Other GridLayout Methods
435(1)
The CardLayout Manager
436(5)
CardLayout Constructor Options
440(1)
Other CardLayout Methods
440(1)
GridBagLayout
441(8)
The GridBagConstraints Object
442(2)
Example
444(4)
GridBagLayout Constructor Options
448(1)
Other GridBagLayout Methods
448(1)
The BoxLayout Manager
449(5)
BoxLayout Constructor Options
452(1)
Other BoxLayout Methods
453(1)
Turning Off the Layout Manager
454(1)
Effective Use of Layout Managers
455(9)
Use Nested Containers
456(3)
Turn Off the Layout Manager for Some Containers
459(2)
Adjust the Empty Space Around Components
461(3)
Summary
464(2)
AWT Components
466(96)
The Canvas Class
468(4)
Creating and Using a Canvas
469(1)
Example: A Circle Component
469(3)
The Component Class
472(7)
Lightweight Components in Java 1.1
479(3)
The Panel Class
482(3)
Default LayoutManager: FlowLayout
482(1)
Creating and Using a Panel
483(1)
Example: Using a Panel for Grouping
483(2)
The Container Class
485(2)
The Applet Class
487(1)
The ScrollPane Class
487(2)
Creating and Using a ScrollPane
487(1)
Example: ScrollPane with 100-Button Panel
488(1)
The Frame Class
489(8)
Default LayoutManager: BorderLayout
489(1)
Creating and Using a Frame
490(1)
Frame Examples
491(1)
A Closeable Frame
492(1)
Menus
493(2)
Other Useful Frame Methods
495(2)
Serializing Windows
497(4)
Writing a Window to Disk
497(1)
Reading a Window from Disk
497(1)
Example: A Saveable Frame
498(3)
The Dialog Class
501(3)
Creating and Using a Dialog
501(1)
Example: A Quit Confirmation Dialog
502(2)
The FileDialog Class
504(3)
Example: Displaying Files in a TextArea
504(3)
The Window Class
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)
The Button Class
512(6)
Constructors
513(1)
Example: Applet with Three Buttons
513(1)
Other Button Methods
514(1)
Handling Button Events
515(3)
The Checkbox Class
518(3)
Constructors
519(1)
Example: Checked Checkboxes
519(1)
Other Checkbox Methods
520(1)
Handling Checkbox Events
521(1)
Check Box Groups (Radio Buttons)
521(3)
Constructors
522(1)
Example: Check Boxes vs. Radio Buttons
522(1)
Other CheckboxGroup and Checkbox Methods
523(1)
Handling CheckboxGroup Events
524(1)
Choice Menus
524(5)
Constructor
525(1)
Example: Simple Choices
525(1)
Other Choice Methods
526(1)
Handling Choice Events
527(2)
List Boxes
529(9)
Constructors
529(1)
Example: Single and Multiple List Selections
529(2)
Other List Methods
531(2)
Handling List Events
533(5)
The TextField Class
538(5)
Constructors
538(1)
Example: Creating TextFields
539(1)
Other TextField Methods
539(3)
Handling TextField Events
542(1)
The TextArea Class
543(2)
Constructors
543(1)
Example: Empty and Filled Text Areas
544(1)
Other TextArea Methods
544(1)
Handling TextArea Events
545(1)
The Label Class
545(5)
Constructors
546(1)
Example: Four Different Labels
546(1)
Other Label Methods
547(1)
Handling Label Events
548(2)
Scrollbars and Sliders
550(6)
Constructors
550(1)
Example: Variety of Sliders
551(1)
Other Scrollbar Methods
552(2)
Handling Scrollbar Events
554(2)
Pop-up Menus
556(4)
Constructors
556(1)
Example: Applet Pop-up Menu
556(2)
Other PopupMenu Methods
558(1)
Handling PopupMenu Events
559(1)
Summary
560(2)
Basic Swing
562(66)
Getting Started with Swing
564(8)
Differences Between Swing and the AWT
564(8)
The JApplet Component
572(2)
The JFrame Component
574(2)
The JLabel Component
576(5)
New Features: Images, Borders, and HTML Content
576(1)
JLabel Constructors
577(1)
Useful JLabel Methods
578(3)
The JButton Component
581(4)
New Features: Icons, Alignment, and Mnemonics
581(1)
HTML in Button Labels
582(1)
JButton Constructors
582(1)
Useful JButton (AbstractButton) Methods
582(3)
The JPanel Component
585(5)
JPanel Constructors
585(1)
New Feature: Borders
585(1)
Useful BorderFactory Methods
586(4)
The JSlider Component
590(4)
New Features: Tick Marks and Labels
590(1)
JSlider Constructors
590(1)
Useful JSlider Methods
591(3)
The JColorChooser Component
594(4)
Constructors
595(1)
Useful JColorChooser Methods
595(3)
Internal Frames
598(4)
JInternalFrame Constructors
598(1)
Useful JInternalFrame Methods
598(4)
The JOptionPane Component
602(5)
Useful JOptionPane Methods
602(5)
The JToolBar Component
607(7)
JToolBar Constructors
609(1)
Useful JToolBar Methods
609(5)
The JEditorPane Component
614(8)
Following Hypertext Links
615(1)
JEditorPane Constructors
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)
The JCheckBox Component
622(1)
The JRadioButton Component
623(2)
The JTextField Component
625(1)
The JTextArea Component
625(1)
The JFileChooser Component
625(1)
Summary
626(2)
Advanced Swing
628(70)
Using Custom Data Models and Renderers
630(1)
JList
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)
JTree
650(14)
Simple JTree
650(4)
JTree Event Handling
654(10)
JTable
664(16)
Simple JTable
664(5)
Table Data Models
669(5)
Table Cell Renderers
674(2)
Table Event Handling
676(4)
Swing Component Printing
680(11)
Printing Basics
681(2)
The Role of Double Buffering
683(1)
A General-Purpose Component-Printing Routine
684(5)
Printing in JDK 1.3
689(2)
Swing Threads
691(5)
SwingUtilities Methods
693(3)
Summary
696(2)
Concurrent Programming with Java Threads
698(62)
Starting Threads
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)
Race Conditions
706(3)
Synchronization
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)
Thread Methods
717(10)
Constructors
718(1)
Constants
719(1)
Methods
719(6)
Stopping a Thread
725(2)
Thread Groups
727(2)
Constructors
727(1)
Methods
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)
Use Double Buffering
743(5)
Animating Images
748(5)
Timers
753(6)
Constructor
757(1)
Other Timer Methods
757(2)
Summary
759(1)
Network Programming
760(70)
Implementing a Client
762(6)
Example: A Genetic Network Client
765(3)
Parsing Strings by Using String Tokenizer
768(3)
The String Tokenizer Class
768(1)
Constructors
769(1)
Methods
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)
UrlRetriever Output
778(1)
The URL Class
779(4)
Reading from a URL
779(2)
Other Useful Methods of the URL Class
781(2)
WebClient: Talking to Web Servers Interactively
783(8)
Implementing a Server
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)
A Simple Example
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)
RMI Applet Example
825(3)
Summary
828(2)
PART 3 SERVER-SIDE PROGRAMMING 830(358)
HTML Forms
832(40)
How HTML Forms Transmit Data
833(5)
The FORM Element
838(5)
Text Controls
843(5)
Textfields
843(2)
Password Fields
845(1)
Text Areas
846(2)
Push Buttons
848(6)
Submit Buttons
849(3)
Reset Buttons
852(1)
JavaScript Buttons
853(1)
Check Boxes and Radio Buttons
854(3)
Check Boxes
854(1)
Radio Buttons
855(2)
Combo Boxes and List Boxes
857(3)
File Upload Controls
860(2)
Server-Side Image Maps
862(5)
IMAGE---Standard Server-Side Image Maps
863(2)
ISMAP---Alternative Server-Side Image Maps
865(2)
Hidden Fields
867(1)
Grouping Controls
868(2)
Tab Order Control
870(1)
Summary
871(1)
Server-Side Java: Servlets
872(92)
The Advantages of Servlets Over ``Traditional'' CGI
874(2)
Efficient
874(1)
Convenient
875(1)
Powerful
875(1)
Portable
875(1)
Secure
876(1)
Inexpensive
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)
Package Your Classes
879(1)
Configure the Server
879(1)
Compile and Install Your Servlets
879(1)
Invoke Your Servlets
880(1)
Basic Servlet Structure
880(7)
A Servlet That Generates Plain Text
882(1)
A Servlet That Generates HTML
883(2)
Simple HTML-Building Utilities
885(2)
The Servlet Life Cycle
887(3)
The init Method
887(1)
The service Method
888(1)
The doGet, doPost, and doXxx Methods
889(1)
The Single ThreadModel Interface
889(1)
The destroy Method
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)
Filtering Query Data
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)
HTTP 1.1 Request Headers
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)
Specifying Status Codes
912(1)
HTTP 1.1 Status Codes
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)
Cookies
941(12)
Benefits of Cookies
942(1)
Some Problems with Cookies
943(1)
The Servlet Cookie API
944(3)
Examples of Setting and Reading Cookies
947(4)
Basic Cookie Utilities
951(1)
Finding Cookies with Specified Names
951(2)
Creating Long-Lived Cookies
953(1)
Session Tracking
953(9)
The Need for Session Tracking
953(2)
The Session Tracking API
955(4)
Terminating Sessions
959(1)
A Servlet Showing Per-Client Access Counts
960(2)
Summary
962(2)
Javaserver Pages
964(100)
JSP Overview
965(2)
Advantages of JSP
967(1)
Versus Active Server Pages (ASP) or ColdFusion
967(1)
Versus PHP
967(1)
Versus Pure Servlets
967(1)
Versus Server-Side Includes (SSI)
968(1)
Versus JavaScript
968(1)
JSP Scripting Elements
968(11)
Expressions
969(3)
Scriptlets
972(3)
Declarations
975(2)
Predefined Variables
977(2)
The JSP page Directive
979(7)
The import Attribute
979(3)
The content Type Attribute
982(1)
The is ThreadSafe Attribute
983(1)
The session Attribute
984(1)
The buffer Attribute
984(1)
The autoflush Attribute
984(1)
The extends Attribute
985(1)
The info Attribute
985(1)
The errorPage Attribute
985(1)
The isErrorPage Attribute
985(1)
The language Attribute
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)
The jsp:fallback Element
995(4)
Using JavaBeans with JSP
999(16)
Basic Bean Use
1001(2)
Example: StringBean
1003(2)
Setting Bean Properties
1005(6)
Sharing Beans
1011(4)
Defining Custom JSP Tags
1015(34)
The Components That Make Up a Tag Library
1015(4)
Defining a Basic Tag
1019(3)
Assigning Attributes to Tags
1022(4)
Including the Tag Body
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)
Using Nested Tags
1042(7)
Integrating Servlets and JSP
1049(13)
Forwarding Requests
1049(4)
Example: An On-Line Travel Agent
1053(9)
Forwarding Requests From JSP Pages
1062(1)
Summary
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)
Summary
1091(1)
JDBC
1092(40)
Basic Steps in Using JDBC
1094(4)
Load the Driver
1094(1)
Define the Connection URL
1095(1)
Establish the Connection
1096(1)
Create a Statement
1096(1)
Execute a Query
1097(1)
Process the Results
1097(1)
Close the Connection
1098(1)
Basic JDBC Example
1098(7)
Some JDBC Utilities
1105(9)
Applying the Database Utilities
1114(6)
An Interactive Query Viewer
1120(7)
Query Viewer Code
1122(5)
Prepared Statements (Precompiled Queries)
1127(4)
Summary
1131(1)
XML Processing with Java
1132(56)
Parsing XML Documents with DOM Level 2
1134(3)
Installation and Setup
1134(1)
Parsing
1135(2)
DOM Example: Representing an XML Document as a JTree
1137(12)
Parsing XML Documents with SAX 2.0
1149(3)
Installation and Setup
1149(1)
Parsing
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)
Installation and Setup
1164(1)
Translating
1165(4)
XSLT Example 1: XSLT Document Editor
1169(10)
XSLT Example 2: Custom JSP Tag
1179(8)
Summary
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)
Monitoring User Events
1198(2)
Mastering JavaScript Syntax
1200(9)
Dynamic Typing
1201(1)
Function Declarations
1201(1)
Objects and Classes
1202(6)
Arrays
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)
Moving Layers
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)
Summary
1272(2)
Javascript Quick Reference
1274(86)
The Array Object
1275(4)
Constructors
1275(1)
Properties
1276(1)
Methods
1276(3)
Event Handlers
1279(1)
The Button Object
1279(2)
Properties
1279(1)
Methods
1280(1)
Event Handlers
1280(1)
The Checkbox Object
1281(2)
Properties
1281(1)
Methods
1282(1)
Event Handlers
1282(1)
The Date Object
1283(3)
Constructors
1283(1)
Properties
1283(1)
Methods
1283(3)
Event Handlers
1286(1)
The Document Object
1286(3)
Properties
1286(2)
Methods
1288(1)
Event Handlers
1289(1)
The Element Object
1289(2)
Properties
1289(1)
Methods
1290(1)
Event Handlers
1291(1)
The FileUpload Object
1291(2)
Properties
1292(1)
Methods
1292(1)
Event Handlers
1292(1)
The Form Object
1293(1)
Properties
1293(1)
Methods
1293(1)
Event Handlers
1294(1)
The Function Object
1294(2)
Constructor
1294(1)
Properties
1295(1)
Methods
1295(1)
Event Handlers
1295(1)
The Hidden Object
1296(1)
Properties
1296(1)
Methods
1296(1)
Event Handlers
1296(1)
The History Object
1296(1)
Properties
1297(1)
Methods
1297(1)
Event Handlers
1297(1)
The Image Object
1297(3)
Constructor
1298(1)
Properties
1298(1)
Methods
1299(1)
Event Handlers
1299(1)
The JavaObject Object
1300(1)
The JavaPackage Object
1300(1)
The Layer Object
1300(4)
Constructor
1300(1)
Properties
1301(1)
Methods
1302(1)
Event Handlers
1303(1)
The Link Object
1304(2)
Properties
1304(1)
Methods
1305(1)
Event Handlers
1305(1)
The Location Object
1306(1)
Properties
1306(1)
Methods
1307(1)
Event Handlers
1307(1)
The Math Object
1307(3)
Properties
1307(1)
Methods
1308(2)
Event Handlers
1310(1)
The MimeType Object
1310(1)
Properties
1311(1)
Methods
1311(1)
Event Handlers
1311(1)
The Navigator Object
1311(3)
Properties
1311(3)
Methods
1314(1)
Event Handlers
1314(1)
The Number Object
1314(3)
Constructor
1315(1)
Properties
1315(1)
Methods
1315(2)
Event Handlers
1317(1)
The Object Object
1317(2)
Constructors
1318(1)
Properties
1318(1)
Methods
1318(1)
Event Handlers
1319(1)
The Option Object
1319(1)
Constructors
1319(1)
Properties
1319(1)
Methods
1320(1)
Event Handlers
1320(1)
The Password Object
1320(2)
Properties
1320(1)
Methods
1321(1)
Event Handlers
1321(1)
The Plugin Object
1322(1)
Properties
1322(1)
Methods
1322(1)
Event Handlers
1322(1)
The Radio Object
1323(1)
Properties
1323(1)
Methods
1323(1)
Event Handlers
1324(1)
The RegExp Object
1324(5)
Constructors
1324(2)
Properties
1326(1)
Methods
1327(1)
Event Handlers
1328(1)
Special Patterns in Regular Expressions
1328(1)
The Reset Object
1329(2)
Properties
1330(1)
Methods
1330(1)
Event Handlers
1330(1)
The Screen Object
1331(1)
Properties
1331(1)
Methods
1332(1)
Event Handlers
1332(1)
The Select Object
1332(3)
Properties
1333(1)
Methods
1334(1)
Event Handlers
1334(1)
The String Object
1335(5)
Constructor
1335(1)
Properties
1335(1)
Methods
1335(5)
Event Handlers
1340(1)
The Submit Object
1340(2)
Properties
1340(1)
Methods
1341(1)
Event Handlers
1341(1)
The Text Object
1342(1)
Properties
1342(1)
Methods
1342(1)
Event Handlers
1343(1)
The Textarea Object
1343(2)
Properties
1344(1)
Methods
1344(1)
Event Handlers
1344(1)
The Window Object
1345(13)
Properties
1345(4)
Methods
1349(5)
Event Handlers
1354(1)
An Example of the open Method
1355(3)
Summary
1358(2)
Index 1360

Excerpts

IntroductionIn late 1995, Marty Hall proposed a new course for the part-time graduate program in Computer Science at the Johns Hopkins University. The idea was to bring together the major Web-related topics in a single course dubbed "Distributed Development on the World Wide Web," with Java technology as a unifying theme. Students would look at HTML, Java, HTTP, CGI programming, and JavaScript, with lots of hands-on projects and no exams. Little did Marty know what he was getting himself into. By the time the first section was offered in the summer of 1996, the Java tidal wave had swept through the university and the companies that the students represented. Shortly after enrollment opened, the class was filled. There were more students on the waiting list than in the course. Marty got frantic phone calls from students insisting that they absolutely had to be in the course. Several local companies called, asking for on-site courses. What fun!However, when Marty went shopping for texts over the next semester or two, he got a rude surprise. Despite the availability of good books in most of the individual areas he wanted to cover, Marty found that he needed three, four, or even five separate books to get good coverage of the overall material. Similarly, for his day job, Marty was constantly switching back and forth among the best of the huge stack of books he had accumulated and various on-line references. Surely there was a better way. Shouldn't it be possible to fit 85 percent of what professional programmers use in about 35 percent of the space, and get it all in one book?That was the genesis of the first edition ofCore Web Programming. The book was very popular, but the industry has been rapidly moving since the book's release. Browsers moved from HTML 3.2 to 4.0. The Java 2 platform was released, providing greatly improved performance and graphics libraries suitable for commercial-quality applications. JSP 1.0 came along, resulting in an explosion of interest in both servlets and JSP as an alternative to CGI and to proprietary solutions like ASP and ColdFusion. XML burst upon the scene. The server equalled or even surpassed the desktop as the biggest application area for the Java programming language.Wow. And demand has only been growing since then. Although readers were clamoring for a new edition of the book, it was just too much for Marty to handle alone. Enter Larry Brown, with broad development and teaching experience in Java and Web technologies, and with particular expertise in the Java Foundation Classes, multithreaded programming, RMI, and XML processing with Java. Larry teamed up with Marty to totally update the existing material to HTML 4, CSS/1, HTTP 1.1, and the Java 2 platform; to replace the CGI sections with chapters on servlets 2.2 and JSP 1.1; and to add completely new sections on Swing, Java 2D, and XML processing with JAXP, DOM Level 2, SAX 2.0, and XSLT. They even got a little bit of sleep along the way.We--Marty and Larry--hope you find the result enjoyable and useful! Real Code for Real ProgrammersThis book is aimed at serious software developers. If you are looking for a book that shows you how to use a browser, lists the current hottest Web sites, and pontificates about how Web-enabled applications will revolutionize your business, you've come to the wrong place. If you're already a programmer of some sort and want to get started with HTML, XML, Java applets, desktop applications in Java, servlets, JavaServer Pages, and JavaScript as quickly as possible, this is the book for you. We illustrate the most important approaches and warn you of the most common pitfalls. To do so, we include plenty of working code: over 250 complete Java classes, for instance. We try to give detailed examples of the most important and frequently used features, summarize the lesser-used ones, and refer you to the API (available on-line) for a

Rewards Program

Write a Review