GWT-php, Simple RPC example


GWT-PHP, using eclispe


Web development possibly has got no end, and im a noob when It comes to that, but I will still try and post whatever problems I have faced or things which I think will be useful
Assuming that we are using eclipse for project development::

Go to windows run and type cmd. On the command line go to the folder where you have GWT (its just easy to create projects and stay in the gwt folder that way).

1)first step is to create a eclipse project with command ::
projectCreator -eclispe NameofEclipseProject -out Nameofprojectfolder.
2)second and final step is creating the gwt application using ::
applicationCreator -out Nameofprojectfolder -overwrite com.yourname.appmin.client.nameofyourentrypointclass

The“com.yourname.appmin.client.nameofyourrntrypointclass” is just an example structure for the gwt application. The only strictness about this structure is the ending part- “blaa.blaa.blaa.client”. The Entry point class has to be contained in the folder called as client.That is something imposed by the creators of gwt.

Go to eclipse , in the menu choose >File>import.
In the window opened , select "existing projects into workspace", browse for the folder we created above while creating the project. There you have it  !!!, your first GWT application.


Something about Gwt

GWT(google webtoolkit) is a web development framework/tool for creating websites/applications using JAVA.
Doesnt mean u dont need to know html,javascript,CSS and other stuff, but it just relieves you of lot of tasks(such as cross browser issues, ajax back button problem,easy development through layouts etc).

Like all the other applications on the web, there will be a interface/page for people to see and interact with , necessarily means something has to be stored in the database and the same has to be retrieved on demand.

When it comes to GWT, client side has to be written in GWT(which is java,What the hell!), now you can use anything(unless you are using Google App engine in which case we can only use python as the server side language(java recently) more here>>) on the server side to store and get the data.

If you are new to GWT you will probably face the problems choosing the backend and also to connect to backend. Here is how we can use GWT to and php. The code below is as basic as it can ever get without any client side widgets or database operations on the backend, but thats the aim, I only intend to tell you how to get started when you have decided to use GWT-php as your way of going about application development.

This is a simple GWT entrypoint class which builds is which will call a php script reciding at the somelocation where you have put it.



Now to run the program we cannot simply run the GWT application and get the result because we have to run the php script in order for gwt to get phpscript. For that, we need to compile the application and put the www folder after the application is compiled into the public html folder of the Webserver u are using.If you are keeping the program as above then put the php script in the same folder (www),Another way (the easier way)is toe give the url of the php script in the gwt project also(Make sure the webserver is running and serving the php scripts).

                                                                                                         :: Back to blog ::