Sunday, September 2, 2012

GWT Project Development Environment - 1.Eclipse

Google Web Toolkit official website
1 Install Google Plugin for Eclipse

The downloading addresses against different versions of eclipse:

Eclipse 4.2 (Juno)

http://dl.google.com/eclipse/plugin/4.2

Eclipse 3.7 (Indigo)

http://dl.google.com/eclipse/plugin/3.7

Eclipse 3.6 (Helios)

http://dl.google.com/eclipse/plugin/3.6

Eclipse 3.5 (Galileo)

http://dl.google.com/eclipse/plugin/3.5
Fill in updating location by your eclipse version.

We select the requisite part only, Google Plugin for Eclipse(required). We will download GWT SDK manually later and link it and eclipse through Google Plugin. Google Plugin for Eclipse will become a bridge between eclipse and GWT SDK. Therefore we can manage GWT SDK easily with it, even Google App Engine SDK.
Another reason why we choose downloading by ourselves rather than installing directly with Google Plugin together is that it can be more convenient to manipulate GWT SDK with command line, because its directory is much simpler and more fixed. Especially after you add it into path of system environment, frequently changing eclipse plugins' directory as a result of various reasons causes its directory to be changed frequently.

2 Download GWT SDK
Google Web Toolkit downloading address
Please notice, if you access the link "Download GWT SDK" directly you will get the latest version, but this latest includes RC. Therefore you should use the link below if you are going to get the latest, stable and released version:
Unzip it after downloading, put it into a directory, the name of which had better be succinct and permanent. For instance, C:\GWT, of course you are going to use it for a long time.  

3 Manage GWT SDK with Google Plugin
Open eclipse Window --> References. If Google plugin was installed correctly there will be a new item, Google. In fact, if installed correctly you will find a new Google icon on tool bar.
Select Web Toolkit, click Browse..., locate GWT SDK. We can manage multiple GWTs of different versions, but let one work only. By the way, App Engine SDK can be added by the same way.

4 GWT_HOME (Optional)
If you want use command line to manipulate GWT SDK, it is undoubtedly the most convenient to add its location to path of system environment. No matter what folder you are in, you can use commands provided by SDK.
But this is not enough, when you create a GWT project, for example, run:

webAppCreator -out MyWebApp com.mycompany.mywebapp.MyWebApp

you will find it is also an ant project. So you need make sure an ant has been installed and set on your computer. Otherwise this project can't be compiled or run by command line.

5 End
You can start your first GWT project with your eclipse now.





Thursday, August 9, 2012

Additional plugins are required to display all the media on this page

Most recently no matter what website I access my Firefox browser will popup a warning 'Additional plugins are required to display all the media on this page',

 but I click 'Install Missing Plugins...' button and it will prompt

This really effects emotion.
How to remove this troublesome warning strip? You just key in about:config in browser's address bar, and change certain item value to true. It's illustrated below.

The item is plugins.hide_infobar_for_missing_plugin.

Tuesday, July 17, 2012

Maven, first web project 1

1. Run maven command below under a folder where you want to create you new project. Use your concrete groupId and artifactId to replace the blue part.

mvn archetype:generate -DgroupId=<groupId> -DartifactId=<artifactId> -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false



2.Now need to create several folders manually to let its struture conform to the maven standard directory layout. After that, you can find its folder struture as such:

websample
    +-src
        +-main
            +-java (Added manually)
            +-resources
            +-webapp
                +-WEB-INF
                    +-web.xml
                +-index.jsp
        +-test (Added manually)
            +-java
            +-resources
    +-pom.xml

3.Now this is web project can be imported into eclipse. Before you do this step you need to make sure there is a maven plugin installed in your eclipse. If there no, recommend m2e.


Now you can add your codes to this web project. In next segment I plan on practising how to integrate it with tomcat and making them become a complete development environment.