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 JavaScriptAjax 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.
Inhaltsverzeichnis
Dedication;
Preface;
Ajax: Some History;
Audience;
Assumptions This Book Makes;
Contents of This Book;
Conventions Used in This Book;
Using Code Examples;
How to Contact Us;
Safari® Books Online;
Acknowledgments;
Chapter 1: Setup;
1.1 Requirements;
1.2 Installing Tomcat;
1.3 Installing Ant;
Chapter 2: JavaScript for Ajax;
2.1 Creating the Application;
2.2 Running the Example;
Chapter 3: A Simple Ajax Servlet;
3.1 Building and Deploying the Ajax Application;
3.2 Running the Example;
Chapter 4: XML and JSON for Ajax;
4.1 The Character Decoder;
4.2 Setting Up a Simple XML Document;
4.3 Back on the Client: Mining the XML;
4.4 Building the Application;
4.5 Running the Application on Tomcat;
4.6 Passing Data with JSON;
4.7 Summary;
Chapter 5: Getting Useful Data;
5.1 Form Entry with Ajax;
5.2 Building a Suggestion Field;
Chapter 6: Ajax Libraries and Toolkits;
6.1 Using the Dojo Toolkit;
6.2 Using the Rico Toolkit;
6.3 Using DWR with Ajax;
6.4 Drag 'n' Drop with Scriptaculous and Prototype;
Chapter 7: Ajax Tags;
7.1 Creating a Tag Library;
7.2 Third-Party Tag Libraries;
Chapter 8: Ajax on Struts;
8.1 Struts-Layout;
8.2 Adding Ajax to Struts with DWR;
8.3 Ajax with Struts: What Have We Learned Here?;
Chapter 9: JavaServer Faces and Ajax;
9.1 The JSF Lifecycle;
9.2 Writing a Custom JSF Component;
9.3 Developing a Custom JSF Tag;
9.4 Handling JSF Input by Extending HtmlInputText;
9.5 Writing the JSF Support for Ajax;
9.6 Summary;
Chapter 10: Google Web Toolkit;
10.1 Getting Started with GWT;
10.2 Debugging the Application;
10.3 Fleshing Out the Application: The Client;
10.4 Supplying Services to the Client;
10.5 Testing ZipCodes with the Service;
10.6 GWT Widgets;
Colophon;