《Ajax on Java》展示了如何通过引入新的Ajax功能包括建议列表、拖放等,使你的Java Web应用程序变得更加丰富多彩。该书列举出多种使用Ajax的不同方式,从“手动”将JavaScript构建到你的应用程序,到利用最新的Google Web Toolkit(GWT)等。当然,你还将从中学会怎样在Struts、JSP和JSF应用程序里使用Ajax。《Ajax on Java》从介绍Ajax开始,教给你如何编写一些基本应用程序,如使用客户端JavaScript程序来向Java servlet请求信息且无需重新加载整个页面便可显示返回结果等。它还展现了若干种客户端与服务器端之间的通信策略,包括发送原始数据以及使用XML或JSON(JavaScript Object Notation)发送更复杂的数据集合。本书分为若干章节,讲述引入Ajax的不同方法。这些方法包括: *Prototype和script.aculo.us JavaScript开发库、Dojo和Rico开发库以及DWR *使用Ajax编写输入表单和建议栏 *创建一个Ajax标记库以及第三方标记库 *将Ajax集成到Java Server Pages(JSP)应用程序 *并用Ajax与Struts *将Ajax集成到Java Server Faces(JSF)应用程序 *利用Google的GWT所提供的纯Java方法来开发Web应用程序:你的客户端组件用Java编写,然后将其编译为HTML和JavaScript 《Ajax on Java》教你如何构建更为交互、动态、振奋人心和让用户感到愉悦的应用程序。如果你是一位Java开发人员但尚未尝试Ajax而你又愿意现在就开始,那么本书正是你的理想读物。你的用户将会因此而感到高兴。
作者简介:
章节目录:
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 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