Before You Begin xxxi
Part 1: Introduction 1
1 Dive Into® Web 2.0 2
1.1 Introduction 3
1.2 What Is Web 2.0? 4
1.3 Search 7
1.4 Content Networks 12
1.5 User-Generated Content 13
1.6 Blogging 16
1.7 Social Networking 19
1.8 Social Media 23
1.9 Tagging 26
1.10 Social Bookmarking 28
1.11 Software Development 29
1.12 Rich Internet Applications (RIAs) 32
1.13 Web Services, Mashups, Widgets and Gadgets 34
1.14 Location-Based Services 37
1.15 XML, RSS, Atom, JSON and VoIP 38
1.16 Web 2.0 Monetization Models 39
1.17 Web 2.0 Business Models 41
1.18 Future of the Web 44
1.19 Where to Go for More Web 2.0 Information 48
1.20 Web 2.0 Bibliography 49
1.21 Web 2.0 Glossary 56
Part 2: The Ajax Client 66
2 Introduction to XHTML 67
2.1 Introduction 68
2.2 Editing XHTML 69
2.3 First XHTML Example 69
2.4 W3C XHTML Validation Service 72
2.5 Headings 72
Cx Contents
2.6 Linking 73
2.7 Images 76
2.8 Special Characters and Horizontal Rules 79
2.9 Lists 81
2.10 Tables 84
2.11 Forms 88
2.12 Internal Linking 95
2.13 meta Elements 98
2.14 Web Resources 99
3 Cascading Style Sheets™ (CSS) 100
3.1 Introduction 101
3.2 Inline Styles 102
3.3 Embedded Style Sheets 103
3.4 Conflicting Styles 106
3.5 Linking External Style Sheets 109
3.6 Positioning Elements 111
3.7 Backgrounds 115
3.8 Element Dimensions 116
3.9 Box Model and Text Flow 118
3.10 Media Types 122
3.11 Building a CSS Drop-Down Menu 124
3.12 User Style Sheets 126
3.13 CSS 3 130
3.14 Web Resources 130
4 Jav aScript: Introduction to Scripting 131
4.1 Introduction 132
4.2 Simple Program: Displaying a Line of Text in a Web Page 133
4.3 Modifying Our First Program 136
4.4 Obtaining User Input with prompt Dialogs 141
4.4.1 Dynamic Welcome Page 141
4.4.2 Adding Integers 145
4.5 Data Types in Jav aScript 147
4.6 Arithmetic 147
4.7 Decision Making: Equality and Relational Operators 148
4.8 Web Resources 152
5 Ja vaScript: Control Statements I 153
5.1 Introduction 154
5.2 Control Statements 154
5.3 if Selection Statement 155
5.4 if…else Selection Statement 156
5.5 while Repetition Statement 160
5.6 Counter-Controlled Repetition 161Contents xi
5.7 Formulating Algorithms: Sentinel-Controlled Repetition 163
5.8 Formulating Algorithms: Nested Control Statements 166
5.9 Assignment Operators 169
5.10 Increment and Decrement Operators 170
5.11 Web Resources 173
6 Jav aScript: Control Statements II 174
6.1 Introduction 175
6.2 Essentials of Counter-Controlled Repetition 175
6.3 for Repetition Statement 177
6.4 Examples Using the for Statement 181
6.5 switch Multiple-Selection Statement 185
6.6 do…while Repetition Statement 190
6.7 break and continue Statements 192
6.8 Labeled break and continue Statements 195
6.9 Logical Operators 197
6.10 Web Resources 202
7 Jav aScript: Functions 203
7.1 Introduction 204
7.2 Program Modules in JavaScript 204
7.3 Programmer-Defined Functions 205
7.4 Function Definitions 205
7.5 Random Number Generation 210
7.6 Example: Game of Chance 215
7.7 Another Example: Random Image Generator 222
7.8 Scope Rules 223
7.9 JavaScript Global Functions 226
7.10 Recursion 227
7.11 Recursion vs. Iteration 230
7.12 Web Resources 231
8 Jav aScript: Arrays 232
8.1 Introduction 233
8.2 Arrays 233
8.3 Declaring and Allocating Arrays 234
8.4 Examples Using Arrays 235
8.5 Random Image Generator Using Arrays 242
8.6 References and Reference Parameters 243
8.7 Passing Arrays to Functions 244
8.8 Sorting Arrays 247
8.9 Multidimensional Arrays 249
8.10 Building an Online Quiz 253
8.11 Web Resources 255xii Contents
9 Jav aScript: Objects 256
9.1 Introduction 257
9.2 Introduction to Object Technology 257
9.3 Math Object 260
9.4 String Object 261
9.4.1 Fundamentals of Characters and Strings 261
9.4.2 Methods of the String Object 262
9.4.3 Character-Processing Methods 264
9.4.4 Searching Methods 265
9.4.5 Splitting Strings and Obtaining Substrings 268
9.4.6 XHTML Markup Methods 269
9.5 Date Object 272
9.6 Boolean and Number Objects 277
9.7 document Object 278
9.8 window Object 279
9.9 Using Cookies 284
9.10 Multipage HTML and JavaScript Application 288
9.11 Using JSON to Represent Objects 296
9.12 Web Resources 297
10 Document Object Model (DOM):
Objects and Collections 298
10.1 Introduction 299
10.2 Modeling a Document: DOM Nodes and Trees 299
10.3 Traversing and Modifying a DOM Tree 302
10.4 DOM Collections 313
10.5 Dynamic Styles 315
10.6 Summary of the DOM Objects and Collections 321
10.7 Web Resources 322
11 Jav aScript: Events 323
11.1 Introduction 324
11.2 Registering Event Handlers 324
11.3 Event onlo ad 327
11.4 Event onmou semove, the event Object and this 328
11.5 Rollovers with onm ouseover and onmo useout 333
11.6 Form Processing with onfo cus and on blur 338
11.7 Form Processing with ons ubmit and onr eset 341
11.8 Event Bubbling 343
11.9 More Events 345
11.10 Web Resources 346
12 XML and RSS 347
12.1 Introduction 348
on 453
14.2 Flash Movie Development 454
14.3 Learning Flash with Hands-On Examples 456
14.3.1 Creating a Shape with the Oval Tool 458
14.3.2 Adding Text to a Button 460
14.3.3 Converting a Shape into a Symbol 461
14.3.4 Editing Button Symbols 463
14.3.5 Adding Keyfr ames 464
14.3.6 Adding Sound to a Button 465
14.3.7 Verifying Changes with Test Movie 466
14.3.8 Adding Layers to a Movie 467
14.3.9 Animating Text with Tweening 468
14.3.10 Adding a Text Field 470
14.3.11 Adding Acti onSc ript 471
14.4 Publishing Your Flash Movie 472xiv Contents
14.5 Creating Special Effects with Flash 473
14.5.1 Impoting and Manipulating Bitmaps 473
14.5.2 Creating an Advertisement Banner with Masking 474
14.5.3 Adding Online Help to Forms 477
14.6 Creating a Website Splash Screen 485
14.7 ActionS cript 491
14.8 Web Resources 491
15 Adobe® Flash® CS3:
Building an Interactive Game 492
15.1 Introduction 493
15.2 Object-Oriented Programming 495
15.3 Objects in Flash 495
15.4 Cannon Game: Preliminary Instructions and Notes 497
15.5 Adding a Start Button 498
15.6 Creating Moving Objects 498
15.7 Adding the Rotating Cannon 503
15.8 Adding the Cannonball 505
15.9 Adding Sound and Text Objects to the Movie 508
15.10 Adding the Time Counter 509
15.11 Detecting a Miss 511
15.12 Adding Collision Detection 512
15.13 Finishing the Game 515
15.14 Act ionSc ript 3.0 Elements Introduced in This Chapter 516
16 Adobe® Flex™ 2 and Rich Internet Applications 517
16.1 Introduction 518
16.2 Flex Platform Overview 519
16.3 Creating a Simple User Interface 520
16.4 Accessing XML Data from Your Application 531
16.5 Interacting with Server-Side Applications 545
16.6 Customizing Your User Interface 554
16.7 Creating Charts and Graphs 558
16.8 Connection Independent RIAs on the Desktop:
Adobe Integrated Runtime (AIR) 566
16.9 Flex 3 Beta 567
16.10 Web Resources 567
Part 4: Rich Internet Application
Server Technologies 568
17 Web Servers (IIS and Apache) 569
17.1 Introduction 570Contents xv
17.2 HTTP Transactions 570
17.3 Multitier Application Architecture 574
17.4 Client-Side Scripting versus Server-Side Scripting 575
17.5 Accessing Web Servers 576
17.6 Microsoft Internet Information Services (IIS) 576
17.6.1 Microsoft Internet Information Services (IIS) 5.1 and 6.0 576
17.6.2 Microsoft Internet Information Services (IIS) 7.0 579
17.7 Apache HTTP Server 581
17.8 Requesting Documents 583
17.9 Web Resources 584
18 Database: SQL, MySQL,
ADO.NET 2.0 and Java DB 585
18.1 Introduction 586
18.2 Relational Databases 587
18.3 Relational Database Overview: A books Database 588
18.4 SQL 591
18.4.1 Basic SELECT Query 591
18.4.2 WHERE Clause 592
18.4.3 ORDER BY Clause 594
18.4.4 Combining Data from Multiple Tables: INNER JOIN 596
18.4.5 INSERT Statement 597
18.4.6 UPDATE Statement 598
18.4.7 DELETE Statement 599
18.5 MySQL 600
18.6 Instructions for Installing MySQL 600
18.7 Instructions for Setting Up a MySQL User Account 601
18.8 Creating a Database in MySQL 602
18.9 ADO.NET Object Model 602
18.10 Java DB/Apache Derby 604
18.11 Web Resources 604
19 PHP 606
19.1 Introduction 607
19.2 PHP Basics 608
19.3 String Processing and Regular Expressions 618
19.3.1 Comparing Strings 618
19.3.2 Regular Expressions 619
19.4 Form Processing and Business Logic 623
19.5 Connecting to a Database 630
19.6 Using Cookies 634
19.7 Dynamic Content 640
19.8 Operator Precedence Chart 649
19.9 Web Resources 651xvi Contents
20 Ruby on Rails 652
20.1 Introduction 653
20.2 Ruby 653
20.3 Rails Framework 660
20.4 ActionContr oller and ActionView 662
20.5 A Database-Driven Web Application 665
20.6 Case Study: Message Forum 670
20.6.1 Logging In and Logging Out 670
20.6.2 Embellishing the Models 674
20.6.3 Generating Scaffold Code 676
20.6.4 Forum Controller and Forum Views 677
20.6.5 Message Controller and Message Views 682
20.6.6 Ajax-Enabled Rails Applications 686
20.7 Script.aculo.us 691
20.8 Web Resources 699
21 ASP.NET 2.0 and ASP.NET Ajax 700
21.1 Introduction 701
21.2 Creating and Running a Simple Web Form Example 702
21.2.1 Examining an ASPX File 703
21.2.2 Examining a Code-Behind File 705
21.2.3 Relationship Between an ASPX File and a Code-Behind File 706
21.2.4 How the Code in an ASP.NET Web Page Executes 706
21.2.5 Examining the XHTML Generated by an ASP.NET Application 707
21.2.6 Building an ASP.NET Web Application 708
21.3 Web Controls 716
21.3.1 Text and Graphics Controls 716
21.3.2 AdRotator Control 721
21.3.3 Validation Controls 726
21.4 Session Tracking 737
21.4.1 Cookies 738
21.4.2 Session Tracking with HttpSessionState 746
21.5 Case Study: Connecting to a Database in ASP.NET 753
21.5.1 Building a Web Form That Displays Data from a Database 754
21.5.2 Modifying the Code-Behind File for the Guestbook Application 763
21.6 Case Study: Secure Books Database Application 765
21.6.1 Examining the Completed Secure Books Database Application 765
21.6.2 Creating the Secure Books Database Application 769
21.7 ASP.NET Ajax 793
21.8 Web Resources 797
22 JavaServer™ Faces Web Applications 798
22.1 Introduction 799
22.2 Java Web Technologies 800Contents xvii
22.2.1 Servlets 800
22.2.2 JavaServer Pages 801
22.2.3 JavaServer Faces 802
22.2.4 Web Technologies in Netbeans 802
22.3 Creating and Running a Simple Application in Netbeans 803
22.3.1 Examining a JSP File 804
22.3.2 Examining a Page Bean File 806
22.3.3 Event-Processing Life Cycle 810
22.3.4 Relationship Between the JSP and Page Bean Files 811
22.3.5 Examining the XHTML Generated by a Java Web Application 811
22.3.6 Building a Web Application in Netbeans 813
22.4 JSF Components 820
22.4.1 Text and Graphics Components 820
22.4.2 Validation Using Validator Components and Custom Validators 825
22.5 Session Tracking 833
22.5.1 Cookies 834
22.5.2 Session Tracking with the SessionBean Object 846
22.6 Web Resources 856
23 Ajax-Enabled JavaServer™ Faces
Web Applications 858
23.1 Introduction 859
23.2 Accessing Databases in Web Applications 860
23.2.1 Building a Web Application That Displays Data from a Database 860
23.2.2 Modifying the Page Bean File for the AddressBook Application 869
23.3 Ajax-Enabled JSF Components 872
23.4 AutoComplete Text Field and Virtual Forms 873
23.4.1 Configuring Virtual Forms 874
23.4.2 JSP File with Virtual Forms and an AutoComplete Text Field 875
23.4.3 Providing Suggestions for an AutoComplete Text Field 879
23.5 Google Maps Map Viewer Component 881
23.5.1 Obtaining a Google Maps API Key 882
23.5.2 Adding a Map Viewer Component to a Page 882
23.5.3 JSP File with a Map Viewer Component 883
23.5.4 Page Bean That Displays a Map in the Map Viewer Component 887
23.6 Web Resources 890
24 Web Services 891
24.1 Introduction 892
24.2 Java Web Services Basics 894
24.3 Creating, Publishing, Testing and Describing a Web Service 894
24.3.1 Creating a Web Application Project and Adding a
Web Service Class in Netbeans 895
24.3.2 Defining the HugeInteger Web Service in Netbeans 895
24.3.3 Publishing the HugeInteger Web Service from Netbeans 900xviii Contents
24.3.4 Testing the HugeInteger Web Service with Sun Java
System Application Server’s Tester Web page 900
24.3.5 Describing a Web Service with the Web Service
Description Language (WSDL) 904
24.4 Consuming a Web Service 905
24.4.1 Creating a Client in Netbe ans to Consume the HugeInt eger
Web Service 905
24.4.2 Consuming the HugeInte ger Web Service 908
24.5 SOAP 914
24.6 Session Tracking in Web Services 915
24.6.1 Creating a Blackjack Web Service 916
24.6.2 Consuming the Blackjack Web Service 920
24.7 Consuming a Database-Driven Web Service from a Web Application 931
24.7.1 Configuring Java DB in Netbeans and Creating the
Reservation Database 931
24.7.2 Creating a Web Application to Interact with the
Reservation Web Service 934
24.8 Passing an Object of a User-Defined Type to a Web Service 939
24.9 REST-Based Web Services in ASP.NET 949
24.9.1 REST-Based Web Service Functionality 950
24.9.2 Creating an ASP.NET REST-Based Web Service 954
24.9.3 Adding Data Components to a Web Service 957
24.10 Web Resources 960
Index 962
No comments:
Post a Comment