GWT Interview Questions and Answers
Q1. What is Google Web Toolkit (GWT)?
GWT presents modes:
Development Mode: allows to debug the Java code of your utility immediately thru the same old Java debugger.
Q2. What are the Important modules in GWT?
JRE Emulation library
Hosted Mode ( Run as java)
Q3. Is GWT works in all the browsers? If sure why?
It way GWT helps Cross browser capability.
Q4. What are the functions of GWT?
Ans: Following are the features of GWT:
Google Web Toolkit (GWT) is a development toolkit to create RICH Internet Application(RIA).
GWT presents developers option to write patron facet software in JAVA.
GWT is open supply, absolutely unfastened, and utilized by thousands of builders round the sector. It is licensed underneath the Apache License model 2.Zero.
Q5. What are the center components of GWT?
Ans: Following are the middle additives of GWT:
JRE Emulation library: Google Web Toolkit consists of a library that emulates a subset of the Java runtime library. The listing includes java.Lang, java.Lang.Annotation, java.Math, java.Io, java.Sq., java.Util and java.Util.Logging.
GWT UI constructing library: This part of GWT includes many subparts which incorporates the real UI components, RPC help, History management, and much more.
Q6. Why would not GWT offer a synchronous server connection option?
Ans: GWT's network operations are all asynchronous, or non-blockading. That is, they return straight away as soon as called, and require the consumer to apply a callback approach to address the consequences when they're sooner or later returned from the server. Though in some cases asynchronous operators are less handy to apply than synchronous operators, GWT does now not offer synchronous operators.
Q7. What is the reason of ‘supply’ tag in *.Gwt.Xml file in GWT?
Ans: This specifies the names of supply folders which GWT compiler will search for supply compilation.
Q8. What is the purpose of ‘public’ tag in *.Gwt.Xml document in GWT?
Ans: The public path is the place to your undertaking where static resources referenced through your GWT module, including CSS or pictures, are saved.
Q9. Which widget represents a single line textual content box in GWT?
Ans: TextBox widget represents a single line textual content box.
Q10. Which widget represents a password textual content field in GWT?
Ans: PasswordTextBox widget represents a textual content box that visually mask its enter to prevent eavesdropping.
Q11. Which widget represents a multiline textual content container in GWT?
Ans: TextArea widget represents a text box that lets in multiple lines of text to be entered.
Q12. Which widget represents a rich text editor in GWT?
Ans: RichTextArea widget represents a wealthy text editor that lets in complex styling and formatting.
Q13. Explain bootstrap procedure for GWT application.
Ans: Following are the stairs of bootstrap proceure for GWT software while a browser hundreds the GWT software −
Browser loads the host html page and .Nocache.Js document.
.Nocache.Js code resolves deferred binding configuarations (for instance, browser detection) and use research table generated by GWT compiler to discover one of the .Cache.Html.
.Nocache.Js code then creates a html hidden iframe, inserts that iframe into the host web page’s DOM, and hundreds the .Cache.Html record into the identical iframe.
.Cache.Html incorporates the actual application of a GWT application and as soon as loaded in iframe shows the GWT utility within the browser.
Q14. What are Modules, Entry Points and HTML Pages in GWT?
Ans: GWT packages are defined as modules. A module "modulename" is defined via a configuration report "modulename.Gwt.Xml". Each module can outline one or extra Entry point lessons.
An access factor is the starting point for a GWT utility, similar to the primary approach in a standard Java program. A Java magnificence that is an access point should put into effect the interface "com.Google.Gwt.Middle.Customer.EntryPoint" which defines the technique onModuleLoad().
The module is hooked up to a HTML page, which is called "host page". The code for a GWT web application executes within this HTML document.
The HTML web page can define "div" containers to which the GWT software can assign UI additives or the GWT UI components are definitely assigned to the frame tag of the HTML web page.
Q15. What are the language differences between web mode and hosted mode?
Q16. What is the motive of the IsSerializable interface in GWT?
Ans: A consumer-described class is serializable if all of the following practice:
It is assignable to IsSerializable or Serializable, both because it immediately implements such a interfaces or because it derives from a superclass that does
All non-very last, non-transient instance fields are themselves serializable, and
As of GWT 1.5, it ought to have a default (zero argument) constructor (with any get admission to modifier) or no constructor at all.
One key distinction though is that , for protection motives, all Serializable classes ought to be included in a serialization policy, that is generated at compile time, at the same time as IsSerializable training do not have that requirement.
If your interest is solely in GWT, and also you do not e.G. Percentage your version lessons between the net utility and another application, I advise you have got your version classes/DTOs implement IsSerializable.
Q17. What is Gwt Sever Side RemoteServiceServlet?
Ans: Public class Remote Service Servlet extends javax.Servlet.Http.HttpServletimplements SerializationPolicyProvider
The servlet base class for your RPC carrier implementations that automatically deserializes incoming requests from the patron and serializes outgoing responses for purchaser/server RPCs.
Q18. How GWT Navigation works?
Ans: In GWT we are able to cope with web page navigation the usage of couple of methods.
Using History tokens.
Clearing the content panel and load the brand new page inside the content material panel.
Q19. What 3d celebration libraries have used with GWT? Which libraries might you suggest? Why?
GUICE: for Server facet dependency injection
GIN: for consumer side dependency injection
GWTP: Model - View - Presenter framework
Q20. Describe how an occasion bus is used and implemented.
Ans: Create a Classs that extends GWTEvent
Define a brand new handler and marker interface for the event elegance.
Register the occasion the use of EventBus in which you implement interface( the only written inside the occasion magnificence)
enforce the interface approach and speak to the occasion fireplace approach
Q21. What is Module descriptor in GWT?
Ans: A module descriptor is the configuration document in the shape of XML that's used to configure a GWT application. A module descriptor record extension is *.Gwt.Xml, wherein * is the call of the software and this document must reside within the venture's root.
Q22. How can we run GWT software?
Ans: Two approaches of walking the application:
Create a battle document and installation in any app server or
Run ant hosted within the command activate. And click on at the ‘Launch Default Browser’.
Q23. How to collect the GWT software?
Ans: Run ant construct inside the root folder of the utility
By default gwt compiler creates optimized JS documents for some browsers.
Disadvantage is it takes numerous time to bring together every alternate because of the diversifications
Open command activate
Go to the application root folder
Run command as "ant build"
Then you could see assemble logs are coming. If you notice BUILD SUCCESSFUL it manner no error to your software. If BUILD FAILED it approach there may be an errors to your software.