You are previewing Deitel.
O'Reilly logo
Deitel

Book Description

The practicing programmer's DEITEL® guide to AJAX, Rich Internet Applications, and web-application development

This book applies the Deitel signature live-code approach to teaching Web 2.0 application development. The book presents concepts in the context of more than 180 fully tested programs (18,000+ lines of code), complete with syntax shading, detailed descriptions, and sample outputs. It features hundreds of tips that will help you build robust applications.

Start with a concise introduction to XHTML, CSS, and JavaScript before rapidly moving on to more advanced client-side development with DOM, XML, AJAX, JSON, and other RIA technologies. Then proceed to server-side development with web servers, databases, PHP, Ruby on Rails, ASP.NET, JavaServer Faces, and web services. When you're finished, you'll have everything you need to build Web 2.0 applications.

The DEITEL Developer Series is designed for practicing programmers. The series presents focused treatments of emerging technologies, including .NET, JavaTM, web services, Internet and web development, and more.

Practical, example-rich coverage of:

  • Web 2.0

  • XHTML, CSS, JavaScript

  • DOM, XML, RSS

  • AJAX-Enabled Rich Internet Applications

  • JSON, Dojo, Script.aculo.us

  • Adobe® Flash CS3 and Flex

  • Web Servers (IIS and Apache)

  • Database (SQL, MySQL, ADO.NET and Java DB)

  • PHP, Ruby on Rails

  • ASP.NET, ASP.NET AJAX

  • JavaServer Faces (JSF)

  • SOAP-Based Web Services in Java

  • REST-Based Web Services in ASP.NET

  • Mashups

  • And more...

  • Visit www.deitel.com to:

  • Download code examples

  • Check out the growing list of programming, Web 2.0, and software-related Resource Centers

  • To receive updates on this book, subscribe to the free DEITEL® BUZZ ONLINE e-mail newsletter at www.deitel.com/newsletter/subscribe.html

  • Read archived Issues of the DEITEL BUZZ ONLINE

  • Contact deitel@deitel.com for information on corporate training courses delivered on-site worldwide


  • Pre-Publication Reviewer Testimonials

    "This book is easily the most comprehensive resource of its kind I've seen yet."
    --Jesse James Garrett, Adaptive Path

    "A one-stop shop for learning the essentials of web programming."
    --Anand Narayanaswamy, ASPAlliance.com

    "Excellent for learning to develop standards-compliant web applications...takes you from the browser to the server and the database, covering web development across many programming languages."
    --Paul Vencill, MITRE, Inc.

    "Cements the browser as a first-class development platform."
    --Johnvey Hwang, Splunk, Inc.

    "Congratulations on this excellent work. The [Dive Into Web 2.0] chapter is simply astonishing! It's one of the better--if not the best--references on Web 2.0."
    --José Antonio González Seco, Parlamento de Andalucia

    "The CSS chapter is compact, concise, and full of useful info!"
    --Billy B. L. Lim, Illinois State University

    "One of the best introductions to JavaScript."
    --Raymond Wisman, Indiana University Southeast

    "A good introduction to the DOM; doesn't trip over cross-browser incompatibilities."
    --Eric Lawrence, Microsoft

    "Exceptionally clear Ajax tutorial; best I've reviewed! Great solutions for the very cool type-ahead and edit-in-place AJAX features. 'Libraries to Help Eliminate Cross-Browser Compatibility Issues' is fantastic. This book and your web sites will be often-visited resources (if not best practices in themselves)."
    --John Peterson, Insync and V.I.O. Inc.

    "Great chapter [on building Flash games]."
    --Jennifer Powers, University of Albany

    "A solid introduction to Adobe Flex with some very cool applications."
    --Matt Chotin, Adobe

    "A solid introduction to the capabilities and flexibilities of PHP. Inspired me to tighten up my own code! Easy to follow JSF development with database, Virtual Forms, and Google Maps."
    --John Peterson, Insync and V.I.O. Inc.

    "Excellent coverage of developing ASP.NET applications, with plenty of sample code."
    --Peter Bromberg, VOIP, Inc.

    "The web services chapter concludes a comprehensive education on Web 2.0. The examples go a long way to support the Web 2.0 mission of this book."
    --George Semeczko, Independent Consultant

    Table of Contents

    1. Copyright
      1. Dedication
    2. Deitel® Series Page
      1. How To Program Series
        1. Simply Series
        2. Deitel Developer Series
      2. SafariX Web Books
    3. Deitel Resource Centers
    4. Preface
      1. Introduction
      2. Key Features
      3. AJAX, Rich Internet Applications and Web Development for Programmers Architecture
      4. Dependency Chart
      5. Teaching Approach
      6. AJAX, Rich Internet Applications and Web Development for Programmers Software Downloads and Additional Resources
      7. Deitel® Buzz Online Free E-mail Newsletter
      8. The Deitel Online Resource Centers
      9. Acknowledgments
        1. Reviewers
      10. About the Authors
      11. About Deitel & Associates, Inc.
    5. Before You Begin
      1. Downloading the Ajax, Rich Internet Applications and Web Development for Programmers Source Code
      2. Web Browsers Used in This Book
    6. 1. Introduction
      1. 1. Dive Into® Web 2.0
        1. 1.1. Introduction
        2. 1.2. What Is Web 2.0?
        3. 1.3. Search
          1. Attention Economy
          2. Google Search
          3. Yahoo!
          4. MSN
          5. Ask
          6. Vertical Search
          7. Location-Based Search
          8. Creating Customized Search Engines
          9. Search Engine Optimization (SEO)
          10. Link Building
          11. Search Engine Marketing (SEM)
          12. Search Engine Watch and Search Engine Land
          13. Search Engine Strategies Conferences
          14. Discovery
        4. 1.4. Content Networks
        5. 1.5. User-Generated Content
          1. Collective Intelligence
          2. Wikis
          3. Collaborative Filtering
          4. Craigslist
          5. Wisdom of Crowds
        6. 1.6. Blogging
          1. History of Blogging
          2. Blog Components
          3. Blogging and Journalism
          4. Growth of Blogging
          5. Blogging and RSS Feeds
          6. Blogging Software
          7. Blog Networks
          8. Blog Search Engines
        7. 1.7. Social Networking
          1. Network Effects
          2. Friendster
          3. MySpace
          4. Facebook
          5. LinkedIn
          6. Xing
          7. Second Life
          8. Gaia Online
          9. Mobile Social Networking
        8. 1.8. Social Media
          1. YouTube
          2. Internet TV
          3. Digg
          4. Last.fm
          5. Digital Rights Management (DRM)
          6. Podcasting
        9. 1.9. Tagging
          1. History of Tagging
          2. Tag Clouds
          3. Folksonomies
          4. Flickr
          5. Technorati
        10. 1.10. Social Bookmarking
          1. del.icio.us
          2. Ma.gnolia
        11. 1.11. Software Development
          1. The Webtop
          2. Software as a Service (SaaS)
          3. Perpetual Beta and Agile Development
          4. Open Source
          5. Licensing: GNU Licenses and Creative Commons
        12. 1.12. Rich Internet Applications (RIAs)
          1. Ajax
          2. Dojo
          3. Flex
          4. JavaFX
          5. Ruby on Rails
          6. Script.aculo.us
          7. JavaServer Faces
          8. ASP.NET Ajax
          9. Adobe Integrated Runtime and Google Gears
        13. 1.13. Web Services, Mashups, Widgets and Gadgets
          1. APIs
          2. Mashups
          3. Widgets and Gadgets
          4. Amazon Web Services
          5. REST (Representational State Transfer)-Based Web Services
        14. 1.14. Location-Based Services
          1. Global Positioning System (GPS)
          2. Mapping Services
          3. GeoRSS and Geotagging
        15. 1.15. XML, RSS, Atom, JSON and VoIP
          1. XML
          2. RSS and Atom
          3. JSON
          4. VoIP
        16. 1.16. Web 2.0 Monetization Models
        17. 1.17. Web 2.0 Business Models
        18. 1.18. Future of the Web
          1. Tagging and Folksonomies
          2. Semantic Web
          3. Microformats
          4. Resource Description Framework (RDF)
          5. Ontologies
          6. Closing Comment
        19. 1.19. Where to Go for More Web 2.0 Information
        20. 1.20. Web 2.0 Bibliography
            1. General Web 2.0
            2. Search
            3. User-Generated Content
            4. Blogging
            5. Social Networking
            6. Social Media
            7. Tagging
            8. Social Bookmarking
            9. Software Development
            10. Rich Internet Applications
            11. Web Services and Mashups
            12. Location-Based Services
            13. XML, RSS, Atom, JSON and VoIP
            14. Internet Business
            15. Semantic Web
        21. 1.21. Web 2.0 Glossary
    7. 2. The Ajax Client
      1. 2. Introduction to XHTML
        1. 2.1. Introduction
        2. 2.2. Editing XHTML
        3. 2.3. First XHTML Example
        4. 2.4. W3C XHTML Validation Service
        5. 2.5. Headings
        6. 2.6. Linking
          1. Hyperlinking to an E-Mail Address
        7. 2.7. Images
          1. Using Images as Hyperlinks
        8. 2.8. Special Characters and Horizontal Rules
        9. 2.9. Lists
          1. Nested Lists
        10. 2.10. Tables
          1. Using rowspan and colspan
        11. 2.11. Forms
          1. Additional Form Elements
        12. 2.12. Internal Linking
        13. 2.13. meta Elements
        14. 2.14. Web Resources
      2. 3. Cascading Style Sheets™ (CSS)
        1. 3.1. Introduction
        2. 3.2. Inline Styles
        3. 3.3. Embedded Style Sheets
        4. 3.4. Conflicting Styles
        5. 3.5. Linking External Style Sheets
        6. 3.6. Positioning Elements
          1. Inline and Block-Level Elements
        7. 3.7. Backgrounds
        8. 3.8. Element Dimensions
        9. 3.9. Box Model and Text Flow
        10. 3.10. Media Types
        11. 3.11. Building a CSS Drop-Down Menu
        12. 3.12. User Style Sheets
        13. 3.13. CSS 3
        14. 3.14. Web Resources
      3. 4. JavaScript: Introduction to Scripting
        1. 4.1. Introduction
        2. 4.2. Simple Program: Displaying a Line of Text in a Web Page
        3. 4.3. Modifying Our First Program
          1. Displaying a Line of Colored Text
          2. Displaying Multiple Lines of Text
          3. Displaying Text in an Alert Dialog
        4. 4.4. Obtaining User Input with prompt Dialogs
          1. 4.4.1. Dynamic Welcome Page
          2. 4.4.2. Adding Integers
        5. 4.5. Data Types in JavaScript
        6. 4.6. Arithmetic
        7. 4.7. Decision Making: Equality and Relational Operators
        8. 4.8. Web Resources
      4. 5. JavaScript: Control Statements I
        1. 5.1. Introduction
        2. 5.2. Control Statements
        3. 5.3. if Selection Statement
        4. 5.4. if...else Selection Statement
        5. 5.5. while Repetition Statement
        6. 5.6. Counter-Controlled Repetition
        7. 5.7. Formulating Algorithms: Sentinel-Controlled Repetition
        8. 5.8. Formulating Algorithms: Nested Control Statements
        9. 5.9. Assignment Operators
        10. 5.10. Increment and Decrement Operators
        11. 5.11. Web Resources
      5. 6. JavaScript: Control Statements II
        1. 6.1. Introduction
        2. 6.2. Essentials of Counter-Controlled Repetition
        3. 6.3. for Repetition Statement
        4. 6.4. Examples Using the for Statement
        5. 6.5. switch Multiple-Selection Statement
        6. 6.6. do...while Repetition Statement
        7. 6.7. break and continue Statements
        8. 6.8. Labeled break and continue Statements
        9. 6.9. Logical Operators
        10. 6.10. Web Resources
      6. 7. JavaScript: Functions
        1. 7.1. Introduction
        2. 7.2. Program Modules in JavaScript
        3. 7.3. Programmer-Defined Functions
        4. 7.4. Function Definitions
          1. Programmer-Defined Function square
          2. Programmer-Defined Function maximum
        5. 7.5. Random Number Generation
        6. 7.6. Example: Game of Chance
        7. 7.7. Another Example: Random Image Generator
        8. 7.8. Scope Rules
        9. 7.9. JavaScript Global Functions
        10. 7.10. Recursion
        11. 7.11. Recursion vs. Iteration
        12. 7.12. Web Resources
      7. 8. JavaScript: Arrays
        1. 8.1. Introduction
        2. 8.2. Arrays
        3. 8.3. Declaring and Allocating Arrays
        4. 8.4. Examples Using Arrays
          1. Creating and Initializing Arrays
          2. Initializing Arrays with Initializer Lists
          3. Summing the Elements of an Array with for and for...in
          4. Using the Elements of an Array as Counters
        5. 8.5. Random Image Generator Using Arrays
        6. 8.6. References and Reference Parameters
        7. 8.7. Passing Arrays to Functions
        8. 8.8. Sorting Arrays
        9. 8.9. Multidimensional Arrays
          1. Arrays of One-Dimensional Arrays
          2. Two-Dimensional Arrays with Rows of Different Lengths
          3. Creating Two-Dimensional Arrays with new
          4. Two-Dimensional Array Example: Displaying Element Values
          5. Common Multidimensional-Array Manipulations with for and for...in Statements
        10. 8.10. Building an Online Quiz
        11. 8.11. Web Resources
      8. 9. JavaScript: Objects
        1. 9.1. Introduction
        2. 9.2. Introduction to Object Technology
          1. Basic Object-Technology Concepts
          2. Classes, Properties and Methods
        3. 9.3. Math Object
        4. 9.4. String Object
          1. 9.4.1. Fundamentals of Characters and Strings
          2. 9.4.2. Methods of the String Object
          3. 9.4.3. Character-Processing Methods
          4. 9.4.4. Searching Methods
          5. 9.4.5. Splitting Strings and Obtaining Substrings
          6. 9.4.6. XHTML Markup Methods
        5. 9.5. Date Object
        6. 9.6. Boolean and Number Objects
        7. 9.7. document Object
        8. 9.8. window Object
        9. 9.9. Using Cookies
        10. 9.10. Multipage HTML and JavaScript Application
          1. The Quiz Page
        11. 9.11. Using JSON to Represent Objects
        12. 9.12. Web Resources
      9. 10. Document Object Model (DOM): Objects and Collections
        1. 10.1. Introduction
        2. 10.2. Modeling a Document: DOM Nodes and Trees
        3. 10.3. Traversing and Modifying a DOM Tree
          1. Finding and Highlighting an Element Using getElementById and className
          2. Creating and Inserting Elements Using insertBefore and appendChild
          3. Replacing and Removing Elements Using replaceChild and removeChild
        4. 10.4. DOM Collections
        5. 10.5. Dynamic Styles
        6. 10.6. Summary of the DOM Objects and Collections
        7. 10.7. Web Resources
      10. 11. JavaScript: Events
        1. 11.1. Introduction
        2. 11.2. Registering Event Handlers
        3. 11.3. Event onload
        4. 11.4. Event onmousemove, the event Object and this
        5. 11.5. Rollovers with onmouseover and onmouseout
        6. 11.6. Form Processing with onfocus and onblur
        7. 11.7. Form Processing with onsubmit and onreset
        8. 11.8. Event Bubbling
        9. 11.9. More Events
        10. 11.10. Web Resources
      11. 12. XML and RSS
        1. 12.1. Introduction
        2. 12.2. XML Basics
          1. Viewing and Modifying XML Documents
          2. Processing XML Documents
          3. Validating XML Documents
          4. Formatting and Manipulating XML Documents
        3. 12.3. Structuring Data
          1. XML Markup for an Article
          2. Viewing an XML Document in Internet Explorer and Firefox
          3. XML Markup for a Business Letter
        4. 12.4. XML Namespaces
          1. Differentiating Elements with Namespaces
          2. Specifying a Default Namespace
          3. Namespaces in XML Vocabularies
        5. 12.5. Document Type Definitions (DTDs)
          1. Creating a Document Type Definition
          2. Defining Elements in a DTD
          3. Defining Attributes in a DTD
          4. Character Data vs. Parsed Character Data
          5. Defining Empty Elements in a DTD
          6. Well-Formed Documents vs. Valid Documents
        6. 12.6. W3C XML Schema Documents
          1. Validating Against an XML Schema Document
          2. Creating an XML Schema Document
          3. Defining an Element in XML Schema
          4. A Closer Look at Types in XML Schema
        7. 12.7. XML Vocabularies
          1. 12.7.1. MathML™
            1. Simple Equation in MathML
            2. Algebraic Equation in MathML
            3. Calculus Expression in MathML
          2. 12.7.2. Other Markup Languages
        8. 12.8. Extensible Stylesheet Language and XSL Transformations
          1. A Simple XSL Example
          2. Using XSLT to Sort and Format Data
          3. Summary of XSL Style-Sheet Elements
        9. 12.9. Document Object Model (DOM)
          1. Overview of the body Element
          2. Global Script Variables
          3. Function loadXMLDocument
          4. Function buildHTML
          5. Function displayDoc
          6. Functions processFirstChild and processLastChild
          7. Functions processNextSibling and processPreviousSibling
          8. Function processParentNode
          9. Common DOM Properties
          10. Locating Data in XML Documents with XPath
        10. 12.10. RSS
          1. RSS 2.0 channel and item Elements
          2. Browsers and RSS Feeds
          3. Creating a Feed Aggregator
          4. Determining the Browser Type and Loading the Documents
          5. Transforming the RSS to XHTML
          6. Displaying the XHTML Markup
        11. 12.11. Web Resources
      12. 13. Ajax-Enabled Rich Internet Applications
        1. 13.1. Introduction
        2. 13.2. Traditional Web Applications vs. Ajax Applications
          1. Traditional Web Applications
          2. Ajax Web Applications
        3. 13.3. Rich Internet Applications (RIAs) with Ajax
        4. 13.4. History of Ajax
        5. 13.5. “Raw” Ajax Example Using the XMLHttpRequest Object
          1. Asynchronous Requests
          2. Exception Handling
          3. Callback Functions
          4. XMLHttpRequest Object Properties and Methods
        6. 13.6. Using XML and the DOM
        7. 13.7. Creating a Full-Scale Ajax-Enabled Application
          1. Using JSON
          2. Rich Functionality
          3. Interacting with a Web Service on the Server
          4. Parsing JSON Data
          5. Creating XHTML Elements and Setting Event Handlers on the Fly
          6. Implementing Type-Ahead
          7. Implementing a Form with Asynchronous Validation
        8. 13.8. Dojo Toolkit
          1. Loading Dojo Packages
          2. Using an Existing Dojo Widget
          3. Asynchronous Requests in Dojo
          4. Partial Page Updates Using Dojo’s Cross-Browser DOM Manipulation Capabilities
          5. Adding Edit-In-Place Functionality
        9. 13.9. Web Resources
    8. 3. Rich Internet Application Client Technologies
      1. 14. Adobe® Flash® CS3
        1. 14.1. Introduction
        2. 14.2. Flash Movie Development
        3. 14.3. Learning Flash with Hands-On Examples
          1. 14.3.1. Creating a Shape with the Oval Tool
          2. 14.3.2. Adding Text to a Button
          3. 14.3.3. Converting a Shape into a Symbol
          4. 14.3.4. Editing Button Symbols
          5. 14.3.5. Adding Keyframes
          6. 14.3.6. Adding Sound to a Button
          7. 14.3.7. Verifying Changes with Test Movie
          8. 14.3.8. Adding Layers to a Movie
          9. 14.3.9. Animating Text with Tweening
          10. 14.3.10. Adding a Text Field
          11. 14.3.11. Adding ActionScript
        4. 14.4. Publishing Your Flash Movie
        5. 14.5. Creating Special Effects with Flash
          1. 14.5.1. Importing and Manipulating Bitmaps
          2. 14.5.2. Creating an Advertisement Banner with Masking
          3. 14.5.3. Adding Online Help to Forms
        6. 14.6. Creating a Website Splash Screen
        7. 14.7. ActionScript
        8. 14.8. Web Resources
      2. 15. Adobe® Flash® CS3: Building an Interactive Game
        1. 15.1. Introduction
        2. 15.2. Object-Oriented Programming
        3. 15.3. Objects in Flash
        4. 15.4. Cannon Game: Preliminary Instructions and Notes
          1. Labeling Frames
          2. Using the Actions Layer
        5. 15.5. Adding a Start Button
        6. 15.6. Creating Moving Objects
          1. Adding the Target
          2. Adding the Blocker
        7. 15.7. Adding the Rotating Cannon
          1. Coding the Cannon’s Rotation
          2. Hiding the Cannon Layer
        8. 15.8. Adding the Cannonball
          1. Initializing the Ball’s Motion Variables
          2. Scripting the Ball’s Motion
        9. 15.9. Adding Sound and Text Objects to the Movie
        10. 15.10. Adding the Time Counter
          1. Adding the Time Box
          2. Creating a Final Animation Sequence
        11. 15.11. Detecting a Miss
        12. 15.12. Adding Collision Detection
          1. Adding Collision Detection to the Target and Blocker
        13. 15.13. Finishing the Game
        14. 15.14. ActionScript 3.0 Elements Introduced in This Chapter
      3. 16. Adobe® Flex™ 2 and Rich Internet Applications
        1. 16.1. Introduction
        2. 16.2. Flex Platform Overview
        3. 16.3. Creating a Simple User Interface
          1. Compiling an Application
          2. Running a Flex Application in the Browser
          3. Embedding Images
          4. Using View States
        4. 16.4. Accessing XML Data from Your Application
          1. Search Function ActionScript
          2. Yahoo! Map ActionScript
          3. Button Event-Handling ActionScript
        5. 16.5. Interacting with Server-Side Applications
          1. ActionScript for Weather Application
        6. 16.6. Customizing Your User Interface
        7. 16.7. Creating Charts and Graphs
        8. 16.8. Connection-Independent RIAs on the Desktop: Adobe Integrated Runtime (AIR)
        9. 16.9. Flex 3 Beta
        10. 16.10. Web Resources
    9. 4. Rich Internet Application Server Technologies
      1. 17. Web Servers (IIS and Apache)
        1. 17.1. Introduction
        2. 17.2. HTTP Transactions
          1. URIs
          2. Parts of a URL
          3. Making a Request and Receiving a Response
          4. HTTP Headers
          5. HTTP get and post Requests
          6. Client-Side Caching
        3. 17.3. Multitier Application Architecture
        4. 17.4. Client-Side Scripting versus Server-Side Scripting
        5. 17.5. Accessing Web Servers
          1. Windows Firewall Settings
        6. 17.6. Microsoft Internet Information Services (IIS)
          1. 17.6.1. Microsoft Internet Information Services (IIS) 5.1 and 6.0
          2. 17.6.2. Microsoft Internet Information Services (IIS) 7.0
        7. 17.7. Apache HTTP Server
        8. 17.8. Requesting Documents
        9. 17.9. Web Resources
      2. 18. Database: SQL, MySQL, ADO.NET 2.0 and Java DB
        1. 18.1. Introduction
        2. 18.2. Relational Databases
        3. 18.3. Relational Database Overview: A books Database
        4. 18.4. SQL
          1. 18.4.1. Basic SELECT Query
          2. 18.4.2. WHERE Clause
          3. 18.4.3. ORDER BY Clause
          4. 18.4.4. Combining Data from Multiple Tables: INNER JOIN
          5. 18.4.5. INSERT Statement
          6. 18.4.6. UPDATE Statement
          7. 18.4.7. DELETE Statement
        5. 18.5. MySQL
        6. 18.6. Instructions for Installing MySQL
          1. Installing MySQL
        7. 18.7. Instructions for Setting Up a MySQL User Account
        8. 18.8. Creating a Database in MySQL
        9. 18.9. ADO.NET Object Model
          1. Namespaces System.Data, System.Data.OleDb and System.Data.SqlClient
          2. ADO.NET’s Disconnected Model
        10. 18.10. Java DB/Apache Derby
        11. 18.11. Web Resources
      3. 19. PHP
        1. 19.1. Introduction
        2. 19.2. PHP Basics
          1. Installing PHP
          2. Simple PHP Program
          3. Converting Between Data Types
          4. Arithmetic Operators
          5. Initializing and Manipulating Arrays
        3. 19.3. String Processing and Regular Expressions
          1. 19.3.1. Comparing Strings
          2. 19.3.2. Regular Expressions
            1. Searching for Expressions
            2. Representing Patterns
            3. Finding Matches
            4. Character Classes
            5. Finding Multiple Instances of a Pattern
        4. 19.4. Form Processing and Business Logic
          1. Superglobal Arrays
          2. Using PHP to Process XHTML Forms
        5. 19.5. Connecting to a Database
        6. 19.6. Using Cookies
          1. Writing Cookies
          2. Reading an Existing Cookie
        7. 19.7. Dynamic Content
        8. 19.8. Operator Precedence Chart
        9. 19.9. Web Resources
      4. 20. Ruby on Rails
        1. 20.1. Introduction
        2. 20.2. Ruby
          1. Installing Instant Rails
          2. Printing a Line of Text
          3. Running a Ruby Script
          4. Variables and Data Types in Ruby
          5. Using Arrays and Hashes
          6. Conditionals, Loops and Code Blocks
          7. Classes
        3. 20.3. Rails Framework
          1. Model-View-Controller
          2. Overview
          3. Creating a Rails Application
        4. 20.4. ActionController and ActionView
          1. Rails Controller
          2. Running Ruby on Rails
          3. Rendering a View
          4. Using a Layout
        5. 20.5. A Database-Driven Web Application
          1. Object Relational Mapping
          2. Creating the Database
          3. Creating the Employee Model
          4. Employee Controller
          5. The list View
        6. 20.6. Case Study: Message Forum
          1. Design
          2. 20.6.1. Logging In and Logging Out
          3. 20.6.2. Embellishing the Models
            1. Message Model
            2. Forum Model
          4. 20.6.3. Generating Scaffold Code
          5. 20.6.4. Forum Controller and Forum Views
            1. List View
            2. New View
            3. Delete View
            4. Forum Layout
          6. 20.6.5. Message Controller and Message Views
            1. List View
            2. New View
            3. Message Layout
          7. 20.6.6. Ajax-Enabled Rails Applications
        7. 20.7. Script.aculo.us
          1. Visual Effects
          2. Other Script.aculo.us Features
          3. Flickr Photo Viewer with Effects
        8. 20.8. Web Resources
      5. 21. ASP.NET 2.0 and ASP.NET Ajax
        1. 21.1. Introduction
        2. 21.2. Creating and Running a Simple Web Form Example
          1. 21.2.1. Examining an ASPX File
          2. 21.2.2. Examining a Code-Behind File
          3. 21.2.3. Relationship Between an ASPX File and a Code-Behind File
          4. 21.2.4. How the Code in an ASP.NET Web Page Executes
          5. 21.2.5. Examining the XHTML Generated by an ASP.NET Application
          6. 21.2.6. Building an ASP.NET Web Application
            1. Step 1: Creating the Website
            2. Step 2: Examining the Solution Explorer of the Newly Created Project
            3. Step 3: Examining the Toolbox in Visual Web Developer
            4. Step 4: Examining the Web Forms Designer
            5. Step 5: Examining the Code-Behind File in the IDE
            6. Step 6: Renaming the ASPX File
            7. Step 7: Renaming the Class in the Code-Behind File and Updating the ASPX File
            8. Step 8: Changing the Title of the Page
            9. Step 9: Designing the Page
            10. Step 10: Adding Page Logic
            11. Step 11: Running the Program
            12. Windows Firewall Settings
        3. 21.3. Web Controls
          1. 21.3.1. Text and Graphics Controls
            1. Adding an XHTML Table to a Web Form
            2. Setting the Color of Text on a Web Form
            3. Examining Web Controls on a Sample Registration Form
          2. 21.3.2. AdRotator Control
            1. Demonstrating the AdRotator Web Control
            2. Connecting Data to an AdRotator Control
            3. Examining an XML File Containing Advertisement Information
          3. 21.3.3. Validation Controls
            1. Validating Input in a Web Form
            2. Using RequiredFieldValidator Controls
            3. Using RegularExpressionValidator Controls
            4. Examining the Code-Behind File for a Web Form That Receives User Input
            5. Examining the Client-Side XHTML for a Web Form with Validation
        4. 21.4. Session Tracking
          1. Personalization
          2. Privacy
          3. Recognizing Clients
          4. 21.4.1. Cookies
            1. Using Cookies to Provide Book Recommendations
            2. Adding and Linking to a New Web Form
            3. Writing Cookies in a Code-Behind File
            4. Displaying Book Recommendations Based on Cookie Values
            5. Code-Behind File That Creates Book Recommendations from Cookies
          5. 21.4.2. Session Tracking with HttpSessionState
            1. Adding Session Items
            2. Displaying Recommendations Based on Session Values
            3. Code-Behind File That Creates Book Recommendations from a Session
        5. 21.5. Case Study: Connecting to a Database in ASP.NET
          1. 21.5.1. Building a Web Form That Displays Data from a Database
            1. Step 1: Creating the Project
            2. Step 2: Creating the Form for User Input
            3. Step 3: Adding a GridView Control to the Web Form
            4. Step 4: Adding a Database to an ASP.NET Web Application
            5. Step 5: Binding the GridView to the Messages Table of the Guestbook Database
            6. Step 6: Modifying the Columns of the Data Source Displayed in the GridView
            7. Step 7: Modifying the Way the SqlDataSource Control Inserts Data
            8. ASPX File for a Web Form That Interacts with a Database
          2. 21.5.2. Modifying the Code-Behind File for the Guestbook Application
        6. 21.6. Case Study: Secure Books Database Application
          1. 21.6.1. Examining the Completed Secure Books Database Application
          2. 21.6.2. Creating the Secure Books Database Application
            1. Step 1: Creating the Website
            2. Step 2: Setting Up the Website’s Folders
            3. Step 3: Configuring the Application’s Security Settings
            4. Step 4: Examining the Autogenerated Web.config Files
            5. Step 5: Creating a Master Page
            6. Step 6: Creating a Content Page
            7. Step 7: Adding a CreateUserWizard Control to a Content Page
            8. Step 8: Creating a Login Page
            9. Step 9: Creating a Content Page That Only Authenticated Users Can Access
            10. Step 10: Customizing the Secure Page
            11. Step 11: Connecting the CreateUserWizard and Login Controls to the Secure Page
            12. Step 12: Generating a DataSet Based on the Books.mdf Database
            13. Step 13: Creating and Configuring an AuthorsTableAdapter
            14. Step 14: Creating and Configuring a TitlesTableAdapter
            15. Step 15: Adding a DropDownList Containing Authors’ First and Last Names
            16. Step 16: Creating a GridView to Display the Selected Author’s Books
            17. Step 17: Examining the Markup in Books.aspx
        7. 21.7. ASP.NET Ajax
          1. ScriptManager Control
          2. Partial Page Updates Using the UpdatePanel Control
          3. Adding Ajax Functionality to ASP.NET Validation Controls Using Ajax Extenders
          4. Additional ASP.NET Information
        8. 21.8. Web Resources
      6. 22. JavaServer™ Faces (JSF) Web Applications
        1. 22.1. Introduction
        2. 22.2. Java Web Technologies
          1. 22.2.1. Servlets
          2. 22.2.2. JavaServer Pages
            1. Custom Tag Libraries
            2. JSP Components
            3. Static Content
            4. Processing a JSP Request
          3. 22.2.3. JavaServer Faces
          4. 22.2.4. Web Technologies in Netbeans
        3. 22.3. Creating and Running a Simple Application in Netbeans
          1. 22.3.1. Examining a JSP File
          2. 22.3.2. Examining a Page Bean File
          3. 22.3.3. Event-Processing Life Cycle
          4. 22.3.4. Relationship Between the JSP and Page Bean Files
          5. 22.3.5. Examining the XHTML Generated by a Java Web Application
          6. 22.3.6. Building a Web Application in Netbeans
            1. Step 1: Creating the Web Application Project
            2. Step 2: Examining the Visual Editor Window of the New Project
            3. Step 3: Examining the Palette in Netbeans
            4. Step 4: Examining the Projects Window
            5. Step 5: Examining the JSP and Java Files in the IDE
            6. Step 6: Renaming the JSP and JSF Files
            7. Step 7: Changing the Title of the Page
            8. Step 8: Designing the Page
            9. Step 9: Adding Page Logic
            10. Step 10: Examining the Outline Window
            11. Step 11: Running the Application
        4. 22.4. JSF Components
          1. 22.4.1. Text and Graphics Components
            1. Adding a Formatting Component to a Web Page
            2. Examining Web Components on a Sample Registration Form
          2. 22.4.2. Validation Using Validator Components and Custom Validators
            1. Validating Form Data in a Web Application
            2. Building the Web Page
            3. Setting the Required Property of an Input Component
            4. Using the LengthValidator Component
            5. Using Regular Expressions to Perform Custom Validation
            6. Examining the Page Bean File for a Form That Receives User Input
        5. 22.5. Session Tracking
          1. Personalization
          2. Privacy
          3. Recognizing Clients
          4. 22.5.1. Cookies
            1. Using Cookies to Provide Book Recommendations
            2. Adding and Linking to a New Web Page
            3. Displaying Book Recommendations Based on Cookie Values
            4. Page Bean That Creates Book Recommendations from Cookies
          5. 22.5.2. Session Tracking with the SessionBean Object
            1. Adding Properties to the SessionBean
            2. Manipulating SessionBean Properties in a Page Bean File
            3. Displaying Recommendations Based on Session Values
            4. Page Bean That Creates Book Recommendations from a SessionBean Property
        6. 22.6. Web Resources
      7. 23. Ajax-Enabled JavaServer™ Faces Web Applications
        1. 23.1. Introduction
        2. 23.2. Accessing Databases in Web Applications
          1. 23.2.1. Building a Web Application That Displays Data from a Database
            1. Step 1: Creating the Project
            2. Step 2: Creating the Form for User Input
            3. Step 3: Adding a Table Component to the Page
            4. Step 4: Creating a Java DB Database
            5. Step 5: Adding a Table and Data to the AddressBook Database
            6. Step 6: Binding the Table Component to the Addresses Table of the AddressBook Database
            7. Step 7: Modifying addressesRowSet’s SQL Statement
            8. Step 8: Adding Validation
            9. JSP File for a Web Page That Interacts with a Database
            10. Session Bean for the AddressBook Application
          2. 23.2.2. Modifying the Page Bean File for the AddressBook Application
        3. 23.3. Ajax-Enabled JSF Components
          1. Downloading the Java BluePrints Ajax-Enabled Components
          2. Importing the Java BluePrints Ajax-Enabled Components into the Netbeans Palette
        4. 23.4. AutoComplete Text Field and Virtual Forms
          1. Adding Search Components to the AddressBook.jsp Page
          2. 23.4.1. Configuring Virtual Forms
          3. 23.4.2. JSP File with Virtual Forms and an AutoComplete Text Field
          4. 23.4.3. Providing Suggestions for an AutoComplete Text Field
        5. 23.5. Google Maps Map Viewer Component
          1. 23.5.1. Obtaining a Google Maps API Key
          2. 23.5.2. Adding a Map Viewer Component to a Page
            1. Adding a Data Provider to the Page
          3. 23.5.3. JSP File with a Map Viewer Component
          4. 23.5.4. Page Bean That Displays a Map in the Map Viewer Component
        6. 23.6. Web Resources
      8. 24. Web Services
        1. 24.1. Introduction
          1. Netbeans
        2. 24.2. Java Web Services Basics
        3. 24.3. Creating, Publishing, Testing and Describing a Web Service
          1. 24.3.1. Creating a Web Application Project and Adding a Web Service Class in Netbeans
            1. Creating a Web Application Project in Netbeans
            2. Adding a Web Service Class to a Web Application Project
          2. 24.3.2. Defining the HugeInteger Web Service in Netbeans
          3. 24.3.3. Publishing the HugeInteger Web Service from Netbeans
          4. 24.3.4. Testing the HugeInteger Web Service with Sun Java System Application Server’s Tester Web page
            1. Testing the HugeInteger Web Service from Another Computer
            2. Note to Windows XP Service Pack 2 and Windows Vista Users
          5. 24.3.5. Describing a Web Service with the Web Service Description Language (WSDL)
            1. Accessing the HugeInteger Web Service’s WSDL from Another Computer
        4. 24.4. Consuming a Web Service
          1. 24.4.1. Creating a Client in Netbeans to Consume the HugeInteger Web Service
            1. Creating a Desktop Application Project in Netbeans
            2. Adding a Web Service Reference to an Application
          2. 24.4.2. Consuming the HugeInteger Web Service
        5. 24.5. SOAP
        6. 24.6. Session Tracking in Web Services
          1. 24.6.1. Creating a Blackjack Web Service
            1. Session Tracking in Web Services
          2. 24.6.2. Consuming the Blackjack Web Service
        7. 24.7. Consuming a Database-Driven Web Service from a Web Application
          1. 24.7.1. Configuring Java DB in Netbeans and Creating the Reservation Database
            1. Creating the Reservation Web Service
          2. 24.7.2. Creating a Web Application to Interact with the Reservation Web Service
            1. Reserve.jsp
            2. Reserve.java
        8. 24.8. Passing an Object of a User-Defined Type to a Web Service
          1. Serialization of User-Defined Types
          2. Requirements for User-Defined Types Used with Web Methods
          3. Defining Class Equation
          4. Creating the EquationGenerator Web Service
          5. Testing the EquationGenerator Web Service
          6. Details of the EquationGenerator Web Service
          7. Consuming the EquationGenerator Web Service
        9. 24.9. REST-Based Web Services in ASP.NET
          1. 24.9.1. REST-Based Web Service Functionality
            1. Accessing the Database
            2. Responses Formatted as JSON
          2. 24.9.2. Creating an ASP.NET REST-Based Web Service
            1. Step 1: Creating the Project
            2. Step 2: Examining the Newly Created Project
            3. Step 3: Modifying and Renaming the Code-Behind File
            4. Step 4 Creating an Item Class
            5. Step 5: Examining the ASMX File
            6. Step 6: Modifying the ASMX File
            7. Step 7: Renaming the ASMX File
            8. Step 8: Changing the Web.Config File to allow REST requests.
            9. Step 9: Adding the System.Web.Extensions Reference
          3. 24.9.3. Adding Data Components to a Web Service
            1. Step 1: Adding a DataSet to the Project
            2. Step 2: Selecting the Data Source and Creating a Connection
            3. Step 3: Opening the Query Builder and Adding the Events Table from Calendar.mdf
            4. Step 4: Configuring a SELECT Query to Obtain a Specific Event
            5. Step 5: Adding Another Query to the EventsTableAdapter for the CalendarDataSet
            6. Step 6: Configuring an UPDATE Statement to Modify a Description of a Specific Event
            7. Step 7: Adding a getItemsByDate Query
            8. Step 8: Testing the Web Service
        10. 24.10. Web Resources
          1. REST-Based Web Services