Google Web Toolkit (GWT) Interview Questions for freshers/Google Web Toolkit (GWT) Interview Questions and Answers for Freshers & Experienced

What Is The Purpose Of 'access-point' Tag In *.Gwt.Xml File In Gwt?

This specifies the name of class if you want to start loading the GWT Application.

What is Deferred Binding?

Deferred Binding is GWT’s answer to Java reflection. Every web browser has its own idiosyncrasies, usually lots of them. The standard Java way of dealing with idiosyncrasies would be to encapsulate the custom code into subclasses, with one subclass for each supported browser. At runtime, the application would use reflection and dynamic classloading to select the appropriate subclass for the current environment, load the class, create an instance, and then use that instance as the service provider for the duration of the program.

This is indeed what GWT does. However, the JavaScript environment in which GWT applications ultimately run simply does not support dynamic classloading (also known as dynamic binding.) Because dynamic binding is unavailable as a technique to GWT, GWT instead uses deferred binding. One way to think of this is as “dynamic class-loading that occurs at compile time instead of execution time.” When the GWT Compiler compiles the Java application, it determines all the different “idiosyncrasies” that it must support, and generates a separate, tightly streamlined version of the application for that specific configuration. For example, it generates a different version of the application file for Firefox than it does for Opera.

The GWT Compiler uses Deferred Binding to generate a completely separate version of the application for each language.

What are the features of GWT

Google Web Toolkit (GWT) is a development toolkit to create RICH Internet Application. GWT provides developers option to write client side application in Java. Application written in GWT is cross-browser compliant. GWT automatically generates javascript code suitable for each browser,.

How is GWT different from other frameworks?

GWT provides a set of ready-to-use user interface widgets that we can immediately utilize to create new applications. It also provides a simple way to create innovative widgets by combining the existing ones. We can use IDE to create, debug, and unit-test our AJAX applications. We can build RPC services to provide certain functionalities that can be accessed asynchronously from the web applications easily using the GWT RPC framework.

GWT enables us to integrate easily with servers written in other languages, so we can quickly enhance our applications to provide a much better user experience by utilizing the AJAX framework. GWT has the Java-to-JavaScript compiler to distill our application into a set of JavaScript and HTML files that we can serve with any web server. This gives us a great feature browser compatibility.

What is the purpose of Label widget of a GWT?

This widget contains text, not interpreted as HTML using a <div>element, causing it to be displayed with block layout.

What are Layout Panels?

Layout Panels can contain other widgets. These panels controls the way widget is displayed on User Interface. Every Panel widget inherits properties from Panel class which in turn inherits properties from Widget class and which in turn inherits properties from UIObject class.

What is GWT RPC

The GWT RPC framework makes it easy for the client and server components of web application to exchange Java objects over HTTP. The server-side code that gets invoked from the client is often referred to as a service. The implementation of the GWT RPC service is based on a Servlet architecture. Within a client code, we will use a automatically generated proxy class to make calls to the service. GWT will handle serialization of the Java objects. GWT RPC service is different from SOAP and REST.

What is the Same Origin Policy, and how does it affect GWT?

Modern browsers implement a security model known as the Same Origin Policy (SOP). Conceptually, it is very simple, but the limitations it applies to JavaScript applications can be quite subtle. Simply stated, the SOP states that JavaScript code running on a web page may not interact with any resource not originating from the same web site. The reason this security policy exists is to prevent malicious web coders from creating pages that steal web users’ information or compromise their privacy. While very necessary, this policy also has the side effect of making web developers’ lives difficult.

It’s important to note that the SOP issues are not specific to GWT; they are true of any AJAX application or framework.

Which class is the superclass of all user-interface classes?

The class UIObject is the superclass for all user-interface objects.

How you can attach a CSS file with your GWT module?

There are multiple approaches for associating CSS files with your module. Modern GWT applications typically use a combination of CssResource and UiBinder.

* Using a <link> tag in the host HTML page.

* Using the <stylesheet> element in the module XML file.

* Using a CssResource contained within a ClientBundle.

* Using an inline <ui:style> element in a UiBinder template.

What is the difference between primary style and secondary styles of a GWT Widget?

By default, the primary style name of a widget will be the default style name for its widget class. For example, gwt-Button for Button widgets. When we add and remove style names using AddStyleName() method, those styles are called secondary styles.

The final appearance of a widget is determined by the sum of all the secondary styles added to it, plus its primary style. You set the primary style of a widget with the setStylePrimaryName(String) method.

What is the purpose of setStylePrimaryName() function of a GWT widget?

This method sets the object's primary style name and updates all dependent style names.

What is the purpose of removeStyleName() function of a GWT widget?

This method will remove given style from the widget and leaves any others associated with the widget.

What is the purpose of addStyleName() function of a GWT widget?

This method will add a secondary or dependent style name to the widget. A secondary style name is an additional style name that is,so if there were any previous style names applied they are kept.

What Is The Purpose Of 'inherits' Tag In *.Gwt.Xml File In Gwt?

This adds different gwt module in application just like import does in java programs. Any quantity of modules may be inherited in this manner.

What is a UiBinder?

UiBinder provides a declarative way of defining User Interface. It helps to separate the programming logic from the UI.

How to create custom widgets in GWT?

There are three general strategies to follow:

Create a widget that is a composite of existing widgets. The most effective way to create new widgets is to extend the Composite class. A composite is a specialized widget that can contain another component (typically, a Panel) but behaves as if it were its contained widget. We can easily combine groups of existing widgets into a composite that is itself a reusable widget. Some of the UI components provided in GWT are composites: for example, the TabPanel (a composite of a TabBar and a DeckPanel) and the SuggestBox. Rather than create complex widgets by subclassing Panel or another Widget type, it’s better to create a composite because a composite usually wants to control which methods are publicly accessible without exposing those methods that it would inherit from its Panel superclass.

Create an entirely new widget written in the Java language. It is also possible to create a widget from scratch, although it is trickier since we have to write code at a lower level. Many of the basic widgets are written this way, such as Button and TextBox.

Create a widget that wraps JavaScript using JSNI methods. When implementing a custom widget that derives directly from the Widget base class, we may also write some of the widget’s methods using JavaScript. This should generally only be done as a last resort, as it becomes necessary to consider the cross-browser implications of the native methods that we write, and also becomes more difficult to debug.

What is DataResource in GWT?

A DataResource is the simplest of the resource types, offering a URL by which the contents of a file can be retrieved at runtime. The main optimization offered is to automatically rename files based on their contents in order to make the resulting URL strongly-cacheable by the browser. Very small files may be converted into data: URLs on those browsers that support them.

What is GWT ClientBundle?

The resources in a deployed GWT application can be roughly categorized into resources to never cache (.nocache.js), to cache forever (.cache.html), and everything else (myapp.css). The ClientBundle interface moves entries from the everything-else category into the cache-forever category.

Why doesn’t GWT provide a synchronous server connection option?

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 operations are less convenient to use than synchronous operations, GWT does not provide synchronous operations.

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.

How can you set Browser targeted Compilation in GWT?

To reduce the compilation time, choose favorite browser and add the user.agent property in the module configuration file.

What is the purpose of Host Page?

The most important public resource is host page which is used to invoke actual GWT application. A typical HTML host page for an application might not include any visible HTML body content at all but it is always expected to include GWT application via a <script.../> tag.

What is the purpose of Host Page?

The most important public resource is host page which is used to invoke actual GWT application. A typical HTML host page for an application might not include any visible HTML body content at all but it is always expected to include GWT application via a <script.../> tag.

Why should a .nocache.js file never be cached?

GWT compiler generates .nocache.js file every time with the same name whenever a GWT application is compiled. So browser should always download the .nocache.js file to get the latest gwt application. gwt.js code actually appends a unique timestamp at the end of the file name so that browser always treat it a new file and should never cache it.

What is .cache.html file in GWT?

It contains the actual program of a GWT application.

What is *.nocache.js file in GWT?

It contains the javascript code required to resolve deferred binding configuarations (for example, browser detection) and to use lookup table generated by GWT compiler to locate one of the .cache.html.

What is an entry-point class?

A module entry-point is any class that is assignable to EntryPoint and that can be constructed without parameters. When a module is loaded, every entry point class is instantiated and its EntryPoint.onModuleLoad() method gets called.

What is the purpose of 'script' tag in *.gwt.xml file in GWT?

Automatically injects the external JavaScript file located at the location specified by src.

What is the purpose of 'source' tag in *.gwt.xml file in GWT?

This specifies the names of source folders which GWT compiler will search for source compilation.

What are the disadvantages of GWT?

Following are the disadvantages of GWT −

* Not indexable − Web pages generated by GWT would not be indexed by search engines because these applications are generated dynamically.

* Not degradable −If your application user disables Javascript then user will just see the basic page and nothing more.

* Not designer's friendly − GWT is not suitable for web designers who prefer using plain HTML with placeholders for inserting dynamic content at later point in time.

What are requirements to install GWT?

Requirements to install GWT:

* To install GWT, first install JDK Java Development Kit on your system as GWT is based on Java.
* JDK should be of version 1.6 or higher than this.
* No minimum requirement of memory, disk space, and operating system
* Install JRE and Eclipse
* Finally, install GWT SDK and plugins and then set up Apache.

What is the difference between TextResource and ExternalTextResource

The related resource types TextResource and ExternalTextResource provide access to static text content. The main difference between these two types is that the former interns the text into the compiled JavaScript, while the latter bundles related text resources into a single file, which is accessed asynchronously.

What is internationalization?

Internationalization is changing the language of the text based on the locale. For example the browser should display the website content in Hindi for a user sitting in India and in French for the user accessing the website from France.

What is the default style name of any GWT widget?

By default, the class name for each component is gwt-<classname>. For example, the Button widget has a default style of gwt-Button and similar way TextBox widgest has a default style of gwt-TextBox.

How onModuleLoad() functions get called if multiple entry-point classes are specified in *.gwt.xml?

They are called sequentially in the order in which entry-point classes appear in the module file. So when the onModuleLoad() of your first entry point finishes, the next entry point is called immediately.

Which method of a entry-point class is called when GWT application starts?

onModuleLoad() function gets called and acts similar to main method of a java application.

What is the purpose of 'entry-point' tag in *.gwt.xml file in GWT?

This specifies the name of class which will start loading the GWT Application.

What is the purpose of 'inherits' tag in *.gwt.xml file in GWT?

This adds other gwt module in application just like import does in java applications. Any number of modules can be inherited in this manner.

What is the purpose of 'module' tag in *.gwt.xml file in GWT?

This provides name of the application.

How do I enable assertions?

The GWT compiler recognizes the -ea flag to generate code for assertions in the compiled JavaScript. Only use assertions for debugging purposes, not production logic because assertions will only work under GWT’s development mode. By default, they are compiled away by the GWT compiler so do not have any effect in production mode unless we explicitly enable them.

Which method of the Entry point class is called when the GWT application is loaded? What happens if there are multiple Entry point classes?

onModuleLoad(). If there are more than one Entry point classes then each of then gets called in the sequence in which they are defined in the configuration file.

What Is Module Descriptor In Gwt?

A module descriptor is the configuration record within the form of XML which is used to configure a GWT utility. A module descriptor file extension is *.Gwt.Xml, in which * is the name of the software and this report need to reside inside the mission's root.

What Are The Components Of A Gwt Application?

A GWT application includes following four vital parts out of which ultimate component is non-obligatory however first three components are mandatory −Module descriptors
Public sources
Client-facet code
Server-facet code

What is an entry point class?

A module entry-point is any class that is assignable to EntryPoint and that can be constructed without parameters. When a module is loaded, every entry point class is instantiated and its EntryPoint.onModuleLoad() method gets called.

What is a GWT Module?

A GWT module is simply an encapsulation of functionality. It shares some similarities with a Java package but is not the same thing. A GWT module is named similarly to a Java package in that it follows the usual dotted-path naming convention. For example, most of the standard GWT modules are located underneath “com.google.gwt” However, the similarity between GWT modules and Java packages ends with this naming convention.

A module is defined by an XML descriptor file ending with the extension “.gwt.xml”, and the name of that file determines the name of the module. For example, if we have a file named src/com/mycompany/apps/MyApplication.gwt.xml, then that will create a GWT module named com.mycompany.apps.MyApplication. The contents of the .gwt.xml file specify the precise list of Java classes and other resources that are included in the GWT module.

What is a module descriptor in GWT application?

A module descriptor is a configuration file used to set-up a GWT application.

What are the components of a GWT application?

A GWT application consists of following four important parts out of which last part is optional but first three parts are mandatory −

* Module descriptors

* Public resources

* Client-side code

* Server-side code

What are the core components of GWT?

Following are the core components of GWT −

GWT Java to JavaScript compiler − This is the most important part of GWT which makes it a powerful tool for building RIAs. The GWT compiler is used to translate all the application code written in Java into JavaScript.

JRE Emulation library − Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list includes java.lang, java.lang.annotation, java.math, java.io, java.sql, java.util and java.util.logging.

GWT UI building library − This part of GWT consists of many subparts which includes the actual UI components, RPC support, History management, and much more.

GWT Hosted Web Browser − GWT Hosted Web Browser lets you run and execute your GWT applications in hosted mode, where your code runs as Java in the Java Virtual Machine without compiling to JavaScript.

What are the features of GWT?

Following are the features of GWT −

* Google Web Toolkit (GWT) is a development toolkit to create RICH Internet Application(RIA).

* GWT provides developers option to write client side application in JAVA.

* GWT compiles the code written in JAVA to JavaScript code.

* Application written in GWT is cross-browser compliant. GWT automatically generates javascript code suitable for each browser.

* GWT is open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache License version 2.0.

What is GWT?

Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. GWT is used by many products at Google, including Google AdWords and Orkut.

Search
R4R Team
R4R provides Google Web Toolkit (GWT) Freshers questions and answers (Google Web Toolkit (GWT) Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,Google Web Toolkit (GWT) Interview Questions for freshers,Google Web Toolkit (GWT) Freshers & Experienced Interview Questions and Answers,Google Web Toolkit (GWT) Objetive choice questions and answers,Google Web Toolkit (GWT) Multiple choice questions and answers,Google Web Toolkit (GWT) objective, Google Web Toolkit (GWT) questions , Google Web Toolkit (GWT) answers,Google Web Toolkit (GWT) MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for Google Web Toolkit (GWT) fresher interview questions ,Google Web Toolkit (GWT) Experienced interview questions,Google Web Toolkit (GWT) fresher interview questions and answers ,Google Web Toolkit (GWT) Experienced interview questions and answers,tricky Google Web Toolkit (GWT) queries for interview pdf,complex Google Web Toolkit (GWT) for practice with answers,Google Web Toolkit (GWT) for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .