闈㈠悜 Java 寮鍙戜漢鍛樼殑 Ajax: 浣跨敤 Google Web Toolkit 寮鍙?Ajax錛欸WT(Google Web Toolkit) 鏄?Google 鏈榪戞帹鍑虹殑涓涓紑鍙?Ajax 搴旂敤鐨勬鏋訛紝瀹冩敮鎸佺敤 Java 寮鍙戝拰璋冭瘯 Ajax 搴旂敤錛屾湰鏂囦富瑕佷粙緇嶅浣曞埄鐢?GWT 榪涜 Ajax 鐨勫紑鍙戙? | |
![]() | |
![]() | 闈㈠悜 Java 寮鍙戜漢鍛樼殑 Ajax: Google Web Toolkit 鍏ラ棬錛欰jax 琚敤浜庡垱寤烘洿鍔犲姩鎬佸拰浜や簰鎬ф洿濂界殑 Web 搴旂敤紼嬪簭銆侴oogle Web Toolkit 錛堢畝縐?GWT錛?鏄?Google 鎺ㄥ嚭鐨?Ajax 搴旂敤寮鍙戝寘錛孏WT 鏀寔寮鍙戣呬嬌鐢?Java 璇█寮鍙?Ajax 搴旂敤銆傛湰鏂囧皢浠嬬粛 GWT 寮鍙?Ajax 搴旂敤鐨勫熀鏈柟娉曞拰姝ラ銆?/td> |
聽Googlipse requires Eclipse 3.2 錛堝繀欏?.2錛墂ith WebTools Platform 1.5錛堜竴瀹氳瑁?錛塺unning on a Java 1.5 VM. You need to separately install Google Web Toolkit from :http://code.google.com/webtoolkit/download.html
Installation:
聽(*) Drop the com.googlipse.gwt_<version>.jar file in your eclipse\plugins folder
聽(*) Open Eclipse. Select Window->Preferences->Googlipse and set GWT home to the directory where you have installed the Google Web Toolkit.
聽(*) You are all set to code.
聽
Adding Googlipse to your project:
聽Googlipse is implemented as a WTP Facet. When creating a new Dynamic Web Project, select Googlipse in the Project Facets page. If you already have a Dynamic Web Project, you can add Googlipse facet by selecting Project->Properties->Project Facets(Please make sure you don't have gwt-user.jar in your classpath). In case you didn't like Googlipse, you can remove the facet.
Creating a Module:
聽Once you have a Dynamic Web Project with Googlipse facet, you can add a new module by File->New->Other->Googlipse->Gwt Module. Modules can be created only in valid java packages (default package is not allowed). Either you can type in the package (with project & source folder) in the location field or you can select it by clicking Browse button. You can also click the Create button to create a new package. Next type in the name of the module. Click Finish, you will have all the artifacts for the module generated.
聽
Adding a Remote Service;
聽Note :A Remote Service will be created only in a module. So if you don't have a module, you need to create one using the New Module wizard, before this step.
聽You can select File->New->Other->Googlipse->Gwt Remote Service. Click the Browse button and select the module (the gwt.xml file). Type the name and uri for the service and click Finish. Now the artifacts for the remote service will be generated. (You have to add an entry in the gwt.xml file manually. Googlipse doesn't add it. This feature will be implemented in future versions)
聽
Adding a Remote Service method:
聽You can open the RemoteService interface and add/change methods in it. You need to provide the implementation of those methods in RemoteServiceImpl class, but thanks to Googlipse, you don't have to do anything in RemoteServiceAsync. Googlipse will automatically update the corresponding Async file whenever a RemoteService interface is changed.
聽
Calling a method using Remote Service:
聽The utility class in the Remote service should help you in making the remote call.
聽
聽MyRemoteServiceAsync async = MyRemoteService.Util.getInstance();
聽async.makeRemoteCall(param1, param2, callback);
聽
Running/Debugging a Gwt Application:
聽Select Run->Run/Debug to activate the Lauch configuration dialog box. Double Click "Gwt Application". In the main page, you can select the Project & Module you want to run. In the parameters page you can select the parameters such as port and log level. Click Run to execute the GwtShell & bring up your application. The laucher will add the jar files & all the source folders in the project to your application.
聽
聽
Questions/Bugs/Suggestions?
聽Drop a mail to googlipse-users@lists.sourceforge.net