Ans: The Google Web Toolkit (GWT) is a toolkit to develop Ajax web application with Java. The programmer writes Java code and this code is translated into HTML and Javascript via the GWT compiler.
The compiler creates browser specific HTML and JavaScript to support all the major browsers correctly. GWT supports a standard set of UI widgets, has build in support for the browser back button and a JUnit based test framework.
Ans:
Ans: Yes GWT works in all the browsers because GWT compiler creates javascript code per browser and per localization.
I meant, if you configure module.xml with Firefox and IE then GWT compiler will create javascript code for both browsers seperately.
And when you load the application it first check from which browser you are opening the application and it will load the corresponding javascript.
It means GWT supports Cross browser functionality.
Ans: Following are the features of GWT:
Ans: Following are the core components of GWT:
Ans: GWT's network operations are all asynchronous, or non-blocking. That is, they return immediately as soon as called, and require the user to use a callback method to handle the results when they are eventually returned from the server. Though in some cases asynchronous operators are less convenient to use than synchronous operators, GWT does not provide synchronous operators.
The reason is that most browsers' JavaScript engines are single-threaded. As a result, blocking on a call to XMLHTTPRequest also blocks the UI thread, making the browser appear to freeze for the duration of the connection to the server. Some browsers provide a way around this, but there is no universal solution. GWT does not implement a synchronous network connection because to do so would be to introduce a feature that does not work on all browsers, violating GWT's commitment to no-compromise, cross-browser AJAX. It would also introduce complexity for developers, who would have to maintain two different versions of their communications code in order to handle all browsers.
Ans: This specifies the names of source folders which GWT compiler will search for source compilation.
Ans: The public path is the place in your project where static resources referenced by your GWT module, such as CSS or images, are stored.
Ans: TextBox widget represents a single line text box.
Ans: PasswordTextBox widget represents a text box that visually masks its input to prevent eavesdropping.
Ans: TextArea widget represents a text box that allows multiple lines of text to be entered.
Ans: RichTextArea widget represents a rich text editor that allows complex styling and formatting.
Ans: Following are the steps of bootstrap proceure for GWT application when a browser loads the GWT application −
Browser loads the host html page and .nocache.js file.
Browser executes the .nocache.js file’s javascript code.
.nocache.js code resolves deferred binding configuarations (for example, browser detection) and use lookup table generated by GWT compiler to locate one of the .cache.html.
.nocache.js code then creates a html hidden iframe, inserts that iframe into the host page’s DOM, and loads the .cache.html file into the same iframe.
.cache.html contains the actual program of a GWT application and once loaded in iframe shows the GWT application in the browser.
Ans: GWT applications are described as modules. A module \"modulename\" is described by a configuration file \"modulename.gwt.xml\". Each module can define one or more Entry point classes.
An entry point is the starting point for a GWT application, similar to the main method in a standard Java program. A Java class which is an entry point must implement the interface \"com.google.gwt.core.client.EntryPoint\" which defines the method onModuleLoad().
The module is connected to a HTML page, which is called \"host page\". The code for a GWT web application executes within this HTML document.
The HTML page can define \"div\" containers to which the GWT application can assign UI components or the GWT UI components are simply assigned to the body tag of the HTML page.
Ans: Typically, if your code runs as intended in hosted mode and compiles to JavaScript without error, web mode behavior will be equivalent. Occasional different problems can cause subtle bugs to appear in web mode that don't appear in hosted mode. Fortunately those cases are rare.
Ans: A user-defined class is serializable if all of the following apply:
It is assignable to IsSerializable or Serializable, either because it directly implements one of these interfaces or because it derives from a superclass that does
All non-final, non-transient instance fields are themselves serializable, and
As of GWT 1.5, it must have a default (zero argument) constructor (with any access modifier) or no constructor at all.
One key difference though is that , for security reasons, all Serializable classes must be included in a serialization policy, which is generated at compile time, while IsSerializable classes do not have that requirement.
If your interest is purely in GWT, and you don\'t e.g. share your model classes between the web application and another application, I suggest you have your model classes/DTOs implement IsSerializable.
Ans: Public class Remote Service Servlet extends javax.servlet.http.HttpServletimplements SerializationPolicyProvider
The servlet base class for your RPC service implementations that automatically deserializes incoming requests from the client and serializes outgoing responses for client/server RPCs.
Ans: In GWT we can handle page navigation using couple of ways.
Ans:
Ans: Create a Classs that extends GWTEvent
Define a new handler and marker interface for the event class.
Register the event using EventBus where you implement interface( the one written inside the event class)
implement the interface method and call the event fire method
Ans: A module descriptor is the configuration file in the form of XML which is used to configure a GWT application. A module descriptor file extension is *.gwt.xml, where * is the name of the application and this file should reside in the project's root.
Ans: Two ways of running the application:
Ans: Run ant build in the root folder of the application
Disadvantage is it takes a lot of time to compile each change because of the permutations
Steps:
Then you can see compile logs are coming. If you see BUILD SUCCESSFUL it means no error in your application. If BUILD FAILED it means there is an error in your application.