Ajax on Java

Steven Douglas Olson

  • 出版商: O'Reilly|英文2書85折
  • 出版日期: 2007-04-03
  • 售價: $1,240
  • 貴賓價: 9.5$1,178
  • 語言: 英文
  • 頁數: 228
  • 裝訂: Paperback
  • ISBN: 0596101872
  • ISBN-13: 9780596101879
  • 相關分類: AjaxJava 程式語言
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

相關主題

商品描述

Description

This practical guide shows you how to make your Java web applications more responsive and dynamic by incorporating new Ajaxian features, including suggestion lists, drag-and-drop, and more. Java developers can choose between many different ways of incorporating Ajax, from building JavaScript into your applications "by hand" to using the new Google Web Toolkit (GWT).

Ajax on Java starts with an introduction to Ajax, showing you how to write some basic applications that use client-side JavaScript to request information from a Java servlet and display it without doing a full page reload. It also presents several strategies for communicating between the client and the server, including sending raw data, and using XML or JSON (JavaScript Object Notation) for sending more complex collections of data.

The book then branches out into different approaches for incorporating Ajax, which include:

  • The Prototype and script.aculo.us Javascript libraries, the Dojo and Rico libraries, and DWR
  • Integrating Ajax into Java ServerPages (JSP) applications
  • Using Ajax with Struts
  • Integrating Ajax into Java ServerFaces (JSF) applications
  • Using Google's GWT, which offers a pure Java approach to developing web applications: your client-side components are written in Java, and compiled into HTML and JavaScript

Ajax gives web developers the ability to build applications that are more interactive, more dynamic, more exciting and enjoyable for your users. If you're a Java developer and haven't tried Ajax, but would like to get started, this book is essential. Your users will be grateful.

 

Table of Contents

Preface

1. Setup

     Requirements

     Installing Tomcat

     Installing Ant

2. JavaScript for Ajax

     Creating the Application

     Running the Example

3. A Simple Ajax Servlet

     Building and Deploying the Ajax Application

     Running the Example

4. XML and JSON for Ajax

     The Character Decoder

     Setting Up a Simple XML Document

     Back on the Client: Mining the XML

     Building the Application

     Running the Application on Tomcat

     Passing Data with JSON

     Summary

5. Getting Useful Data

     Form Entry with Ajax

     Building a Suggestion Field

6. Ajax Libraries and Toolkits

     Using the Dojo Toolkit

     Using the Rico Toolkit

     Using DWR with Ajax

     Drag 'n' Drop with Scriptaculous and Prototype

7. Ajax Tags

     Creating a Tag Library

     Third-Party Tag Libraries

8. Ajax on Struts

     Struts-Layout

     Adding Ajax to Struts with DWR

     Ajax with Struts: What Have We Learned Here?

9. JavaServer Faces and Ajax

     The JSF Lifecycle

     Writing a Custom JSF Component

     Developing a Custom JSF Tag

     Handling JSF Input by Extending HtmlInputText

     Writing the JSF Support for Ajax

     Summary

10. Google Web Toolkit

     Getting Started with GWT

     Debugging the Application

     Fleshing Out the Application: The Client

     Supplying Services to the Client

     Testing ZipCodes with the Service

     GWT Widgets

Index

商品描述(中文翻譯)

描述

這本實用指南向您展示如何通過加入新的Ajax功能(包括建議列表、拖放等)使您的Java Web應用程序更具響應性和動態性。Java開發人員可以選擇多種不同的方式來整合Ajax,從手動將JavaScript集成到應用程序中,到使用新的Google Web Toolkit(GWT)。

《Ajax on Java》從介紹Ajax開始,向您展示如何編寫一些基本應用程序,使用客戶端JavaScript向Java servlet請求信息並在不刷新整個頁面的情況下顯示它。它還介紹了幾種在客戶端和服務器之間通信的策略,包括發送原始數據,以及使用XML或JSON(JavaScript對象表示法)發送更複雜的數據集。

然後,本書介紹了不同的整合Ajax的方法,包括:
- Prototype和script.aculo.us JavaScript庫,Dojo和Rico庫以及DWR
- 將Ajax整合到Java ServerPages(JSP)應用程序中
- 使用Ajax與Struts
- 將Ajax整合到Java ServerFaces(JSF)應用程序中
- 使用Google的GWT,它提供了一種純Java的開發Web應用程序的方法:您的客戶端組件是用Java編寫的,並編譯為HTML和JavaScript

Ajax使Web開發人員能夠構建更具互動性、動態性、令人興奮和愉悅的應用程序。如果您是一名Java開發人員,並且尚未嘗試過Ajax,但希望開始使用,這本書是必不可少的。您的用戶將感激不已。

目錄

前言
1. 安裝設置
- 需求
- 安裝Tomcat
- 安裝Ant
2. Ajax的JavaScript
- 創建應用程序
- 運行示例
3. 簡單的Ajax Servlet
- 構建和部署Ajax應用程序
- 運行示例
4. Ajax的XML和JSON
- 字符解碼器
- 設置簡單的XML文檔
- 客戶端操作:解析XML
- 構建應用程序
- 在Tomcat上運行應用程序
- 使用JSON傳遞數據
- 總結
5. 獲取有用的數據
- 使用Ajax進行表單輸入
- 構建建議字段
6. Ajax庫和工具包
- 使用Dojo工具包
- 使用Rico工具包
- 使用DWR進行Ajax
- 使用Scriptaculous和Prototype進行拖放
7. Ajax標籤
- 創建標籤庫
- 第三方標籤庫
8. Ajax在Struts中
- Struts-Layout
- 使用DWR將Ajax添加到Struts
- Ajax與Struts:我們在這裡學到了什麼?
9. JavaServer Faces和Ajax
- JSF生命周期