O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DWR Java AJAX Applications

Book Description

A step-by-step example-packed guide to learning professional application development with Direct Web Remoting

  • Learn Direct Web Remoting features from scratch and how to apply DWR practically

  • Topics such as configuration, testing, and debugging are thoroughly explained through examples

  • Demonstrates advanced elements of creating user interfaces and back-end integration

  • Contains easy-to-understand explanations, realistic examples, and complete demo applications

In Detail

AJAX enables rich desktop-like user interfaces in the browser and enables interactive interfaces that can even replace traditional user interfaces. DWR (Direct Web Remoting) is an Open Source Java framework for building AJAX applications. DWR's main idea is to hide AJAX implementation details, like XMLHttpRequest, from developers. By using DWR, you can concentrate on developing the application and business objects and leave AJAX details behind the scenes where they belong. DWR allows server-side Java classes to be used in the browser and JavaScript functions to be used on the server (Reverse AJAX).

This book will show competent Java programmers how to work with DWR to create powerful AJAX applications. It starts with a tutorial on DWR's main features and functions. Then it covers setting up the development environment. Finally, it concludes with some sample applications.

The later chapters are full of example code for sample applications, to aid comprehension.

This book covers all the theoretical and practical knowledge required for working with DWR. The book is packed with code and graphics with step-by-step explanations.

Table of Contents

  1. DWR Java AJAX Applications
  2. Credits
  3. About the Author
  4. About the Reviewers
  5. Preface
    1. What This Book Covers
    2. What You Need for This Book
    3. Who is This Book For
    4. Conventions
    5. Reader Feedback
    6. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Piracy
      4. Questions
  6. 1. Introduction
    1. What is AJAX?
    2. DWR: AJAX for Java Developers
    3. The DWR Community
    4. Summary
  7. 2. DWR Features
    1. Ease of Use
    2. Reverse AJAX
      1. Piggyback
      2. Polling
      3. Comet
    3. DWR JavaScript Libraries
      1. engine.js
      2. util.js
      3. gi.js
    4. Converters
    5. Creators, Filters, and Signatures
    6. Integration with Other Projects
    7. Security
      1. Minimize Risks
    8. Summary
  8. 3. Getting Started
    1. Supported Browsers and Environments
    2. Configuration
      1. web.xml
      2. dwr.xml
        1. Using Creator and Its Attributes
        2. Using the Converter Element
        3. Working with Annotations
        4. Using Fluent Configuration with DWR
    3. Setting up a Development Environment
      1. Development Environment with DWR and Firefox
      2. Development Environment with Eclipse
        1. Apache Geronimo
    4. Testing and Debugging
    5. Error Handling
    6. Packaging and Deployment
      1. Deployment Using the Administration Console
      2. Deployment Using the Deployer Tool
      3. Deployment Using Hot Deployment
    7. Summary
  9. 4. User Interface: Basic Elements
    1. Creating a Dynamic User Interface
      1. Creating a New Web Project
      2. Configuring the Web Application
      3. Developing the Web Application
        1. Testing the Web Application
        2. Developing Web Pages
      4. Callback Functions
      5. Afterword
    2. Implementing Tables and Lists
      1. Server Code for Tables and Lists
      2. Client Code for Tables and Lists
      3. Testing Tables and Lists
      4. Afterword
    3. Implementing Field Completion
      1. Server Code for Field Completion
      2. Client Code for Field Completion
      3. Afterword
    4. Summary
  10. 5. User Interface: Advanced Elements
    1. Creating Forms
      1. Developing the User Interface
      2. Creating the FormHandler Class
      3. Testing the Form
      4. Afterword
    2. Building a Navigation Tree
      1. Developing the User Interface
      2. Creating the NavigationTree Class
      3. Developing the User Interface, Part 2
      4. Testing the Navigation Tree
      5. Afterword
    3. Map Scrolling Using DWR
      1. Developing the User Interface
      2. Creating the MapScroller Java Class
      3. Testing the Map Scroller
      4. Afterword
    4. Summary
  11. 6. Backend Integration
    1. Integrating a Database with DWR
      1. Configuring the Database in Geronimo
      2. Creating a CountryDerbyDB Java Class
      3. Testing the Database Integration
      4. Afterword
    2. Integrating with Web Services
      1. Developing the Web Service Client
      2. Implementing the Web Service Call
      3. Testing Web Services Integration
      4. Afterword
    3. Integrating with a Messaging System
      1. Setting up Queues in Geronimo
      2. Developing the OrderSystem Java Class
      3. Setting up the Application for Messaging
      4. Testing with the Backend OrderSystem
      5. Afterword
    4. Summary
  12. 7. Sample Applications
    1. Collaborative Book Authoring
      1. Starting the Project
      2. Developing the User Interface
        1. index.jsp
        2. loginFailed.html
        3. mainpage.jsp
      3. Configuring the Web Application
      4. Developing the Java Classes
        1. Login.java
        2. UserDatabase.java
        3. Util.java
        4. Book.java
        5. BookDatabase.java
      5. Testing Collaborative Book Authoring
      6. Afterword
    2. Chatroom
      1. Starting the Project and Configuration
      2. Developing the User Interface
      3. Developing the Java Code
      4. Testing the Chat
      5. Afterword
    3. Summary