GWT

Read this article to know what is GWT and how to install GWT plugin and create GWT application in eclipse.

GWT stands for Google Web Toolkit. It's a development toolkit and a framework to made rich internet applications. GWT provides developers choice to jot down consumer facet application in Java. Whereas aggregation GWT application, GWT compiler converts writing Java code into JavaScript and executes into browser specific level. This can be additionally referred to as cross browser compliant. 

GWT mechanically generates JavaScript code appropriate for every browser. GWT is open supply, it's completely free, utilized by thousands of developers around the world. It's authorized  underneath the Apache 2.0. GWT application is high performance Internet application whereas keeping straight forward to maintains.
Why to use GWT?
  • You can use Java IDE's like Eclipse to develop GWT application. Developers can use code auto-complete/refactoring/project management and all features of IDE's.
  • GWT provides full debugging capability. Developers can debug the client side application just as an Java Application.
  • GWT provides easy integration with Junit, Maven.
  • Being Java based, GWT has a low learning for Java Developers.
  • GWT generates optimized JavaScript code, produces browser's specific code by self.
  • GWT provides Widgets library most of tasks required in an application.
  • GWT is extensible and Custom widget can be created to application needs.
  • GWT application can run on all major browsers and smart phones including Android and ios based phones.
Disadvantages of GWT
        GWT comes with more plus points, at the same time we should consider following drawbacks.
  • Not Indexable:
    Which web pages are generated by GWT would not be indexed by search engines because those applications are generated by dynamically.
  • Not degradable:
    If your application user disables Java Script then user will see the basic page and nothing more.
  • Not designers friendly:
    GWT is not suitable for web designers who prefer to use plain HTML with placeholders for inserting dynamic content at later point in time.
GWT framework divided into 3 major parts:
  • GWT Java to Javascript Compiler:
    This is the most important part of GWT which makes it as a powerful tool for building Rich Internet Applications(RIA). GWT compiler is used to translate all the application code written in java into Javascript.
  • JRE Emulation Library:
    GWT includes a library that emulates a subset of Java Runtime Library. The list includes java.lang, java.lang.annotation, java.math....
  • GWT UI building library:
    This part of GWT consists of many sub parts which includes the actual UI Components, RPC Support, History Management and more.
        GWT also provides GWT Hosted Web Browser to run and execute your GWT applications in hosted mode, where your code runs as Java in the JVM without compiling to Javascript.

What are different modes to run GWT application?
We will run GWT applications in 2 different modes,
                              1. Development Mode,
                              2. Web Mode.

Development mode: While you develop your GWT application, you'll run your application in development mode. Running like this, gwt consumer stuff is ran by eclipse plugins as java code. permitting right, tracing in console.

Web mode: When you run it during a web mode, on a external server, you've got to export/deploy war files. Before this, you ran the gwt compiler that converts java code to several flavors of Java Script matching precisely every browser capabilities.

       These are called 'permutations' when you do "google>compile gwt".


Download GWT: 

       For GWT is not required to install any software, it's required to download GWT and set that path into computer properties path. 
  • You can download required version of GWT by clicking the link.
  • Once your downloading will be completed, extract that .zip and place that folder into C drive for standard.
       Copy the path of the downloading GWT folder path and add it into computer properties path.

GWT plugin for Eclipse:
Eclipse Version
Plugin
Eclipse(Juno)3.8/4.2
Eclipse 4.3 (Kepler)
Eclipse 3.7
Eclipse 3.6
Eclipse 3.5
Eclipse 3.4

        
Based on your eclipse type and version you can copy the plugin and run eclipse. Once your eclipse started go into 'Help' --> select 'Install new software'.

       
In that you'll be able to past the plugin uniform resource locator and wait a while. Once method completes which will show you the list of obtainable software's there under plugin. Will choose your demand connected otherwise you can choose solely that are chosen in below image. Once choosing the specified software's list , currently press 'Next' button to makeover more in plugin installation.



        Once you have got selected  following button, the plugin installation method can begin, wait up to method completes and so press 'Finish' button.

       Once you have got put in GWT plugin in your eclipse, you'll restart you eclipse. once you have restarted your eclipse before rectify and run buttons one special button can show that's the GWT button with the image of 'g'.



        Your GWT plugin installation completed.

How to create GWT project?
        Once your GWT plugin installation completes and therefore the GWT symbol is showing in eclipse, click on the GWT image, which will show you list of GWT choices as like below,


         In that you'll be able to choose 'New web Application Project' to make new GWT project. once you have choose the higher than choice which will show you the below popup. therein you must fill the small print of Project Name and package name.

        If you're attending to use solely GWT solely you must uncheck Use Google App Engine check box for avoiding the event mode running issues.



        Then click 'Finish' button to form new GWT project. Once you have got finished project creation, that may generate the below project structure with the sample GWT source code.




How to run the GWT project in development mode?
Once you're finishing the GWT project creation, now, you'll right click on the project folder in eclipse and choose Run as and choose web Application as below within the image.



        Once you're running your application as web application that will generate one url as like below



        That link you'll copy and paste it into normal browser. Higher to run within the Mozilla Firefox. Once urban center inserting and running the on top of universal resource locator in any browser which will raise you to put in GWT plug for that specific browser. You'll transfer and place that browser plug into browser add-on's and re-run the universal resource locator it'll show you the results of the project.





Comments

Post a Comment

Popular posts from this blog

Hibernate auto increment with example

how to count the page views by using JSP

Multithreading in java with example

How to retrieve data from table by using JDBC with example

Prime, Fibonacci and Factorial number with example in java

How to insert images into database using JDBC?

How to sort list of objects in java with examples

String interview questions and answers

Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/SystemException

Store file into table by using JDBC with example