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. Approach The initial part guides the reader through the features of DWR and how it works to make the developer ready for practical implementation. The later part contains plenty of code (with explanations) and graphical interface-driven step-by-step examples, which the reader can try out while surfing through the book to learn by doing. Who this book is for This book is written for competent Java developers and assumes that you are a professional rather than hobbyist. You should be familiar with the concepts of programming, Web 2.0, and AJAX. Cover......Page 1 Table of Content......Page 8 Preface......Page 12 What is AJAX?......Page 18 DWR: AJAX for Java Developers......Page 20 The DWR Community......Page 22 Summary......Page 23 Chpater 2: DWR Features......Page 24 Piggyback......Page 25 Polling......Page 26 Comet......Page 27 DWR JavaScript Libraries......Page 29 engine.js......Page 30 util.js......Page 31 Converters......Page 34 Creators, Filters, and Signatures......Page 35 Integration with Other Projects......Page 36 Security......Page 37 Minimize Risks......Page 38 Summary......Page 39 Chpater 3: Getting Started......Page 40 web.xml......Page 41 dwr.xml......Page 43 Using Creator and Its Attributes......Page 44 Using the Converter Element......Page 45 Working with Annotations......Page 46 Using Fluent Configuration with DWR......Page 47 Development Environment with Eclipse......Page 48 Testing and Debugging......Page 52 Error Handling......Page 53 Packaging and Deployment......Page 55 Deployment Using the Administration Console......Page 58 Deployment Using the Deployer Tool......Page 61 Summary......Page 62 Creating a Dynamic User Interface......Page 64 Creating a New Web Project......Page 66 Configuring the Web Application......Page 68 Developing the Web Application......Page 70 Testing the Web Application......Page 71 Developing Web Pages......Page 75 Callback Functions......Page 80 Afterword......Page 81 Implementing Tables and Lists......Page 82 Server Code for Tables and Lists......Page 83 Client Code for Tables and Lists......Page 90 Testing Tables and Lists......Page 96 Implementing Field Completion......Page 98 Server Code for Field Completion......Page 99 Client Code for Field Completion......Page 100 Summary......Page 106 Creating Forms......Page 108 Developing the User Interface......Page 109 Creating the FormHandler Class......Page 112 Testing the Form......Page 114 Developing the User Interface......Page 117 Creating the NavigationTree Class......Page 119 Developing the User Interface, Part 2......Page 121 Testing the Navigation Tree......Page 124 Map Scrolling Using DWR......Page 126 Developing the User Interface......Page 128 Creating the MapScroller Java Class......Page 135 Testing the Map Scroller......Page 137 Summary......Page 140 Integrating a Database with DWR......Page 142 Configuring the Database in Geronimo......Page 143 Creating a CountryDerbyDB Java Class......Page 149 Testing the Database Integration......Page 153 Integrating with Web Services......Page 154 Developing the Web Service Client......Page 155 Implementing the Web Service Call......Page 162 Testing Web Services Integration......Page 163 Integrating with a Messaging System......Page 164 Setting up Queues in Geronimo......Page 165 Developing the OrderSystem Java Class......Page 169 Setting up the Application for Messaging......Page 172 Testing with the Backend OrderSystem......Page 174 Summary......Page 176 Collaborative Book Authoring......Page 178 Developing the User Interface......Page 179 index.jsp......Page 181 mainpage.jsp......Page 182 Configuring the Web Application......Page 193 Login.java......Page 195 UserDatabase.java......Page 197 Util.java......Page 198 Book.java......Page 199 BookDatabase.java......Page 201 Testing Collaborative Book Authoring......Page 208 Starting the Project and Configuration......Page 213 Developing the User Interface......Page 214 Developing the Java Code......Page 218 Testing the Chat......Page 220 Summary......Page 222 Index......Page 224 Annotation. 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