Intermediate / 1 to 5 years experienced level questions
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. What are the disadvantages of GWT?
Problems with indexing by search engines - IMHO, this should be the biggest disadvantage of using GWT, or pure JS web applications in general. Since the content, layout, everything is created "on-the-fly" with JS, the search engine will only see a very short HTML page and that's that - you have to take care of this somehow yourself (for example, using cloaking). Google has finally started to work on a solution for this, however it doesn't seem to attractive to me.
Update: Google has finally addressed this problem. However, I'll leave this as a trade-off because making the application crawable still requires more effort than in other frameworks. At least now we have a "standard" to follow and don't have to use some dubious techniques (like cloaking).
Need lot of memory to run it in dev mode.
High compile time.
Every server call will be ajax.
You will loose control on your javascript.
Ques 2. Is GWT works in all the browsers? If yes why?
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.
Ques 3. What is Bootstrap process in GWT or How an applications loads in GWT?
HTML
|
nocache.js ( Bootstrap javascript file )
|
|->( Loads the browser specific files)
|
module.xml ( *.gwt.xml )
|
|->( which loads the entry point class )
|
onModuleLoad() method
|
|
|
Loads the application
Ques 4. What are the GWT Panels?
RootPanel is the top level panel.
For layout the page, we could use following layout panels, finally we need to add all those layout panels in RootPanel.
DockLayoutPanel
SplitLayoutPanel
StackLayoutPanel
TabLayoutPanel
Use below panels inside the Layout panels for holding the widgets.
HorizontalPanel
VerticalPanel ( Prefer using FlowPanel )
Ques 5. How to work with Server side communication?
Using GWT RPC
To user GWT RPC we need to create couple of interfaces and one implementation class.
1. Synchronous interface
2. Asynchronous interface
3. Implementation class implements Synchronous interface.
Ques 6. How are we going to get the response from server side?
For this purpose only GWT has one Asynchronous interface which has one parameter called AsyncCallBack, using this callback object it will call the client side code once the server completed the execution.
So basically all the calls to server side method will have two call back methods
onSuccess()
onFailure()
If the server side method executed properly then onSuccess() method will be called otherwise onFailure() method will be called, so based on this we can proceed with our functionality.
Ques 7. How GWT Navigation works?
In GWT we can handle page navigation using couple of ways.
1. Using History tokens
2. Clearing the content panel and load the new page in the content panel.
Most helpful rated by users:
- What is Google Web Toolkit (GWT)?
- How many modes are provided by GWT to execute application?
- What are Modules, Entry Points and HTML Pages in GWT?
- How can you set Browser targeted Compilation in GWT?
- How can we run GWT application?