Product Details
Ajax on Java

Ajax on Java
By Steven Douglas Olson

List Price: $29.99
Price: $22.79 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

46 new or used available from $5.08

Average customer review:

Product 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.


Product Details

  • Amazon Sales Rank: #492191 in Books
  • Published on: 2007-02-01
  • Original language: English
  • Number of items: 1
  • Binding: Paperback
  • 211 pages

Editorial Reviews

About the Author
Steven Olson has been a software developer for 20 years, starting in 1984 with ForTran, Pascal, Basic, and, later, C at a company called Signetics. In 1991, he went to work for Novell, writing C. He began dabbling in Java, and in 1995 was one of the first to join the Java development group at Novell. Since then, he has consulted or worked directly for eight other companies writing primarily in Java. Currently, he works for logoworks.com, where his programming adventures continue.


Customer Reviews

Save Your Money1
Sad to say, this book is little more than a code dump, and the code does not run without debugging.

There are no explanations of technologies and concepts that surround Ajax, therefore, given the state of the code, there is not a lot of reason to work through the book. In fact, this is the first computer book that I returned to the seller, simply because I found so little reason to keep it on my bookshelf.

The writing in the introductory chapter gives promise, but as the book progresses the code quickly becomes dense and the organization and writing becomes unacceptably thin. I expected more from O'Reilly.

Before I gave up on this book, I was half way through it, and only one code set had ran correctly from build on. For example, the author's code has at least four variations of the basic application URL sprinkled among the Javascript and build files of the first four examples. Finding and correcting the URL was annoying but not difficult, but even after that, the examples did not run without further debugging.

I finally threw up my hands and surrendered... defeated by the author's rush to publication.

Good, thorough review of the basics with extensize examples5
Ajax on Java is exactly what you need when you want to try Ajax out, with Java, in a hurry. I have read through it completely and have tried more than half of the example projects and found it to be a great resource to get me started toward using Ajax right away in our shop. One of the things I like best about this book is that it emphasizes doing the work needed to learn the material. I am a fan of the 'see one, do one, teach one' school of learning and this book fits that methodology perfectly. There may be thicker, wordier and more comprehensive books on Ajax but I am willing to bet (figure of speech, please, no offers to wager are actually intended!) that none of them will do as good a job as Ajax on Java did for me.

Brings responsiveness to your Java web applications5
With Ajax, you can build web applications that have a quick response but lack the overhead of keeping the user current with the latest software. This book introduces you to Ajax by illustrating how to create such responsive applications on the server side in a Java environment. The reader should be a Java programmer with web application experience and a knowledge of working with Java servlets, HTML, and JavaScript. Struts, XML, and JavaServer Faces are mentioned in the later chapters, and to understand those chapters you should understand those technologies too.

The first chapter shows you how to install Apache Ant and the servlet container, Tomcat. Next the book shows you the complete HTML and JavaScript code for your first Ajax application, a simple web page that displays the decimal value of any character. This example is then broken apart and examined piece by piece. The third chapter focuses on the backend of what was written in the previous chapter, which is the Java servlet that provides the client with the information it needs. Thus, a servlet is created that converts the user keystroke to decimal and sends the resulting data back to the client. Chapter four is about XML and JavaScript Object Notation (JSON) for Ajax. Besides illustrating how XML makes it easy to parse data coming from the server, this chapter also demonstrates how to use JSON, a native JavaScript data representation that can be more convenient than XML. The example in chapter four returns five pieces of data instead of just one. This highlights the need for XML to structure the data that is being sent from server to client.

Next, the book deals with the ubiquitous Order-entry application using Google Suggest as a model. You learn to write web applications that tell users immediately when they have requested usernames that are already in use, that fill in a city and state automatically on the basis of a zip code, and that make it simpler to enter the names of entities that already exist in the database. Up to this point in the book, XMLHttpRequest has been used to send requests to the server and set up callback methods to intercept the responses coming back from the server. Next the book uses ready-made libraries and toolkits to build the request object and set up the callback function. Using a toolkit also eliminates the separate code that handles Internet Explorer and the other browsers. The toolkits examined are the Dojo Toolkit, Rico Toolkit, DWR Toolkit, Scriptaculous, and Prototype. In chapters five and six, code was developed that enabled the finding of city and state information based on a user-entered zip code. Next the book shows how to add this feature to a tag library, encapsulating the details of the Ajax code.

Chapter eight investigates two approaches to adding Ajax features to Struts applications. One uses Struts-Layout, which implements some Ajax features. The second method uses the DWR library that was first introduced in chapter six. This chapter isn't a tutorial on or introduction to Struts, though. Next, the book turns to the subject of JavaServer Faces (JSF) and presents one way to add Ajax to a JSF application by using a custom JSF component. The Ajax request is shown being processed from the viewpoint of the JSF lifecycle. Instead of writing HTML or JSPs, or JSF pages combined with JavaScript, with Java servlets or JSF components to handle the server side of the application, the Google Web Toolkit (GWT) lets you write the whole application, from client to server, in Java. It generates all the JavaScript automatically, based on the Java code you write. You still need to write some HTML, but GWT provides skeleton HTML as a starting point. GWT also handles all cross-browser issues for you. It also eases the chore of debugging. This chapter provides a pretty good tutorial for the GWT.

I thought this book did a good job of showing how Ajax technology can make Java web applications more responsive. Just remember that if you are not familiar with technologies such as JavaServer Faces, Struts, or XML, you will need some outside sources on these topics as no tutorial is included.