Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 38 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
38
Dung lượng
618,4 KB
Nội dung
[...]... Along these same lines, one of the main tools GWT provides is the GWT shell 12 1. 2.5 CHAPTER 1 Introducing GWT GWT shell All of the great features GWT includes are built on the core of the architectural approach and the GWT compiler But wait! There’s more! GWT also includes a nice set of developer tools starting with the GWT shell and hosted mode browser, which is shown in figure 1. 3 The GWT shell allows... 1. 1 shows a sample module file Listing 1. 1 Calculator .gwt. xml module definition b Inherit core GWT classes Define EntryPoint Specify CSS file to use c d 14 CHAPTER 1 Introducing GWT This module file is pretty basic... again, they work, even when deep-linked into a particular area of the application Leveraging the parts of the web that do work well is intentional with GWT, as is GWT s extension of the RIA landscape to provide tooling and testing support 1. 1.4 Tooling and testing Another of the reasons GWT is significant and is different from some other RIA offerings is that it provides tooling and testing support GWT. .. core.client.EntryPoint interface, which defines a single method: onModuleLoad() This is the GWT equivalent of a class with the method public static void main() declared in Java—a place to begin Again borrowing from the calculator example we’ll build in chapter 2, listing 1. 3 shows an example EntryPoint implementation Listing 1. 3 The entry point for the Calculator class public class Calculator implements EntryPoint {... control logging output The logging display is controlled by the -logLevel option on the GWTShell command line Valid log levels are shown in table 1. 2; the default level is INFO Table 1. 2 Log Level GWTShell -logLevel options Description ERROR Shows only critical errors in the GWT shell code WARN Shows uncaught exceptions in user code WARN and ERROR information are displayed in red in the shell window INFO... move into development with GWT GWT in Practice also looks at working with technologies you may be familiar with, but that have different usage patterns in the GWT world These include using the Java Persistence API with Hibernate or TopLink, working with build tools, testing, and continuous integration These are at the core of modern enterprise application development but can be problematic for new GWT. .. for handling communications with a host web server, internationalization support, and testing mechanisms Figure 1. 1 An overview of the GWT approach Java source code is compiled into JavaScript, which is then run in a web browser as JavaScript/HTML/CSS Why GWT 5 GWT provides a platform for creating true “Rich” Internet Applications (RIAs)—rich in the sense of allowing the client to maintain state and... same-origin policy, and ways to work around it, in chapter 5 When a module nocache script (either version—standard or cross-site) is loaded from a host page, the remainder of the GWT bootstrap process is invoked and an entry point class is loaded 16 1. 3.3 CHAPTER 1 Introducing GWT Entry point classes An entry point class is a simple client-side class that implements the com.google .gwt core.client.EntryPoint... helpful in everything, always about this book Welcome to GWT in Practice This book is intended to serve as a practical field guide for developers working with the Google Web Toolkit While it includes some introductory information, it is not a complete introduction to all the classes and libraries included with GWT It is, however, a guide to working around common issues developers encounter when building GWT. .. most during development: the GWT shell 1. 4 Working with the GWT shell The GWT shell, which we briefly introduced in section 1. 2.5, is one of the most important components GWT provides, and one you’ll use every day when developing GWT applications We’ll cover it in more detail here, and we’ll touch on it again in other chapters when specific situations warrant it The shell is composed of three main parts: . communications 11 2 Making basic HTTP requests with GWT 11 2 ■ Making advanced HTTP requests with GWT 11 4 ■ Working with XML 11 5 5.3 Understanding Java-to-JavaScript interaction 11 6 Using GWT JavaDoc. Integration 211 8 .1 GWT testing 212 Knowing what to test 212 ■ How GWT testing works 213 Testing gotchas 214 ■ Basic GWT tests 217 ■ Testing outside of GWT 224 8.2 Advanced testing concepts. collections 11 6 Using JSON 11 9 5.4 Creating a cross-domain SOAP client with Flash 12 1 Using Flash as a SOAP client 12 1 ■ Setting a Flash security context 13 0 ■ Drawbacks and caveats 13 1 5.5 Incorporating