Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

GWT Interview Questions and Answers

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

Values: ie6,ie8,gecko1_8,safari,opera

module.gwt.xml:
<module..>
<inherits...>
<set property name="user.agent" value="ie8,opera">
</module..>

Is it helpful? Add Comment View Comments
 

Ques 7. How to compile the GWT application?

Run ant build in the root folder of the application
•By default gwt compiler creates optimized JS files for some browsers.
–Disadvantage is it takes a lot of time to compile each change because of the permutations

Steps:
1) Open command prompt
2) Go to the application root folder
3) Run command as "ant build"

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.

Is it helpful? Add Comment View Comments
 

Ques 8. How to create a GWT application?

•Create a folder for the application (e.g. withoutbook)
•Run webAppCreator in the newly created folder
–webAppCreator takes a module name (here 'withoutbook' is the module name with a package prefix)

Is it helpful? Add Comment View Comments
 

Ques 9. What are the features in GWT?

To simply put ‘Write JavaScript using JAVA’


And in a little more detail:

Compiles JAVA code into JavaScript code

Takes care of cross browser compatibility by generating a browser specific code

Not client side alone. Has a deployable server side components (which is not compiled into JavaScript)

Client communicates to server via GWT-RPC call (if services are written using GWT),

Supports http calls using JSON and XML format

Supports AJAX calls

With JSNI (Javascript native interface) can mix javascript code with java code

java can call javascript method

javascript can call java method

Is it helpful? Add Comment View Comments
 

Ques 10. Why to use GWT / what are the advantages to use GWT?

You're using Java - it means that your webdevs' proficiency in javascript won't come in handy as much (it will be helpful if you dabble in JSNI)

It's easy (especially for a beginner in GWT, especially when that person comes from a HTML/JS background - without too much object-oriented experience) to go all "wow, these 'object' things are so cool, let me make all my <div>s into separate objects, that will make the code all nice and neat". Of course, I'm over-exaggerating it, but you get the point - it's easy to imagine that an unexperienced programmer could put a full-blown Widget with lots of Handlers in every cell of a FlexTable... And then (s)he'll waste a lot of time wondering why the application feels sluggish ;) tl;dr: it's easy for beginners in GWT to make their applications "bloaty" by writing code in java.

The Compiler - now, most people talked with about GWT doesn't realize just how amazing this part of GWT is - for starters try this presentation from last year's Google IO. The compiler has the view of the whole application.

One nifty thing about GWT is that you get performance gains and new features for free with almost every new release of the framework. Since it's Java compiled to JavaScript.

Debugging - it is worth mentioning that you can (and should :)) debug your GWT apps just like any other Java application, using your IDE's debugger. And, in general, the Java debuggers I've seen are more advanced then their JavaScript counterparts.

UiBinder - while it's still not "perfect", UiBinder let's you design your Widgets in an easy and intuitive way using XML (as opposed to the pre-2.0 way that forced you to do this in Java). Mixing HTML and GWT's Widgets has never been so easy and fun.

Working with CSS - GWT has always, of course, embraced CSS, but with the introduction of GWT 2.0 (and UiBinder) they took it to another level. Let's look at a CSS file from a "normal" web application - hundreds, if not thousands of lines, hard to navigate, some styles are redundant but it's hard to notice that, some aren't used at all, add to this mix the need to please IE6/7 and you get yourself a nightmare. With GWT, you can instruct it to perform the similar tasks it did for the JS code for CSS - so it will prune all the unused CSS styles, merge where appropriate, minimize and obfuscate the class names, and many more (including conditionals, constants, etc in your CSS files). You are encouraged to keep your styles in their respective UiBinder's XML files - makes organizing and finding them so much easier. Last but not least, you get an error when you misspell a CSS style name - less hassle then trying to do the same via Firebug or a similar tool.

OOPHM - Out of Process Hosted Mode, with this, they fixed one of the biggest disadvantages of GWT - now, you get to use Hosted Mode in the browser of your choice (if that choice is Firefox, Safari, IE or Chrome, but at least you can use any version you want). The design of OOPHM also allows you to do cool stuff like run Windows in a VM, and connect from the IE there to the Hosted Mode running on the host OS (Linux/MacOS) - no need for hacks, copying files after every compile, etc.

The out-of-box collection of Widgets is kept small and simple. Now, if you're coming from some full-blown GUI framework (be it web or desktop), you might be surprised at how relatively small the number of Widgets GWT has. But according to the GWT's devs, it's kept like this on purpose - the basic Widgets are all the tools/"blocks" you need to build your own, customized to your needs Widgets.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook