Wt (web toolkit) interview Questions for Freshers/Wt (web toolkit) Interview Questions and Answers for Freshers & Experienced

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 are the components of GWT?

* GWT Java-to-JavaScript Compiler: It translates all the Java written code into JavaScript.
* GWT Development Mode: It allows the developers to run the application in development mode, i.e., app run in Java without compiling JavaScript. Development mode allows native mode plug-in called Google Web Toolkit Developer Plug-in.
* JRE emulation library: GWT includes a library that follows the Java runtime library i.e. java.lang, java.lang.annotation, java.math, java.io, java.sql, java.util etc.
* GWT Web UI class library: For creating a widget GWT consist of the set of interface and classes.

What are the components of GWT?

To communicate with the server from the browser without using GWT RPC:

* Create a connection to the server, using the browser’s XMLHTTPRequest feature.
* Construct a payload, convert it to a string, and send it to the server over the connection.
* Receive the server’s response payload, and parse it according to the protocol.

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

Can we create mobile apps using GWT?

It is not correct to say that GWT is meant to develop applications that run on browsers. As we know GWT is based on Java and translate Java to JavaScript, and also includes IDE and Ui support which helps to make web apps. You can make some application wrappers that takes JavaScript applications native to androids or other operating systems of mobiles. This is how you can design mobile apps with the use of a glue layer present in between native wrapper and GWT for a JavaScript app.

Yeah, it is true that you can't make apps only with GWT, instead, you need other libraries. Thus, it is fully possible to make apps using GWT by combining it with other libraries.

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.

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 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 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 setStyleName() function of a GWT widget?

This method will clear any existing styles and set the widget style to the new CSS class provided using style.

What is default public path for static resources in GWT application?

The default public path is the public subdirectory underneath where the Module XML File is stored.

.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.

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.

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 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.

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 is AsyncDataProvider in GWT cell widgets?

AsyncDataProvider ties your cell widgets to an asynchronous data source. The AsyncDataProvider used to fetch the new data when the cell widget requires new data and then push it to the widget. To request the new data, implement the oRangeChanged() method for the specified cell widget. To push the data, call updateRowCount() and/or updateRowData() methods.

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.

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 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 UiBinder in GWT?

UiBinder is a framework used to separate the functionality and view of a user interface. It allows developers to build GWT applications such as HTML pages with GWT widgets.

* It collaborates with UI designers who like to work in XML, HTML, and CSS than Java source code
* It increases productivity as it is easy to create UI from scratch.
* It encourages the separation of the programming logic i.e. Java code from UI.
* It prefers lightweight HTML elements over heavyweight widgets and panel, which directly increase the use of browser resources efficiently.
* Provides direct support for internationalization that works well with GWT.
* Provides thorough compile-time verification of cross-checking from XML to java source and vice-versa.

What is AsyncDataProvider in GWT cell widgets?

AsyncDataProvider ties your cell widgets to an asynchronous data source. The AsyncDataProvider used to fetch the new data when the cell widget requires new data and then push it to the widget. To request the new data, implement the oRangeChanged() method for the specified cell widget. To push the data, call updateRowCount() and/or updateRowData() methods.

What are important modules of GWT?

Some standard modules are:

* User Module: It contains core GWT functionality
* HTTP Module: It consists of Low-level HTTP communications library
* JSON Module: It has JSON creation and parsing
* JUnit Module: It contains JUnit testing framework integration
* XML Module: It includes XML document creation and parsing

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 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 *.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 'source' tag in *.gwt.xml file in GWT?

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

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 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.

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.

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.

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.

List some benefits of using CssResource, ImageResource, TextResource in GWT?

CssResource allows you to insert CSS files into your application. Call CssResource.ensureInjected() at runtime to inject the content of the stylesheet.

ImageResource provides access to an image data in the most effective way.

TextResource allows you to access the content of a file which is contained in the compiled file.

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.

What is Module descriptor in GWT?

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.

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 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 ajax application using Java. GWT insist on reusable approaches to common web-app tasks such as bookmarking, UI abstraction, cross-browser portability, etc.

GWT provides two modes:

1. Development Mode: It allows debugging the Java code of the application directly via the standard Java debugger.

2. Web mode: In this, the application is translated into HTML and JavaScript code. It can be deployed to a web server.

Search
R4R Team
R4R provides Wt (web toolkit) Freshers questions and answers (Wt (web toolkit) 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,Wt (web toolkit) interview Questions for Freshers,Wt (web toolkit) Freshers & Experienced Interview Questions and Answers,Wt (web toolkit) Objetive choice questions and answers,Wt (web toolkit) Multiple choice questions and answers,Wt (web toolkit) objective, Wt (web toolkit) questions , Wt (web toolkit) answers,Wt (web toolkit) 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 Wt (web toolkit) fresher interview questions ,Wt (web toolkit) Experienced interview questions,Wt (web toolkit) fresher interview questions and answers ,Wt (web toolkit) Experienced interview questions and answers,tricky Wt (web toolkit) queries for interview pdf,complex Wt (web toolkit) for practice with answers,Wt (web toolkit) for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .