How can I connect gwt-compiled javascript code with a php and mysql backend and run it in localhost?
I'm using localhost to run php scripts on mySQL using XAMPP. However, I would like to create interactive UIs using GWT and connect it to php scripts and mySQL backends. I know that this is possible using JSON but I'm having a hard time figuring out how to set up the development environment in my PC so that I can run gwt + php + mysql on my own 开发者_Python百科machine. I'm developing the GWT interfaces using eclipse in Windows 7. Can anyone please point me to the right direction? Also any tutorials regarding this combination of coding is highly appreciated. I've already found this: http://sites.google.com/site/angelhurtado/tutorialgwt2
Thanks.
In eclipse you need to compile your GWT module. To do this you need to right click on the .gwt.xml file(in eclipse) and go to "Run As" > "Compile GWT Application". This will compile the code into the war directory. Now you can just copy the contents of the "war" directory into your php server and access index.html. Once this is complete you can now set it up to run in development mode. To do this you right click on the .gwt.xml file again and go to "Run As" > "Web Application". This will not work as it is configured, but this step is necessary to get it to create the template you will now edit. Now go to the green arrow up top and click the little black arrow next to it and go to "Run Configurations". From there expand the "Web Application" list and click on the module. Now click on the "Server" tab and uncheck the "Run built-in server" field. Then go to the "Arguments" tab and change the .html file location after -startupUrl to the full path to the .html file on your php server. Then click apply and run. A url will show up in the development mode tab which you just copy and paste into your browser, which if you have the development mode plugin installed will run the GWT application in dev mode and allow you to make changes realtime without recompiling and also debug.
精彩评论