GWT

一.GWT组件安装

素材:
①com.google.gdt.eclipse.suite.4.5.update.site_3.9.2(GWT组件)
②appengine-java-sdk-1.8.3(AppEngine)
③gwt-2.2.0(GWT SDK核心工具包)
④安装环境MyEclipse10

开始安装GWT:

           1.关闭MyEclipse10,解压①(两个文件夹features和plugins)到X:\***\MyEclipse 10\dropins,打开MyEclipse10,查看工具栏多出这个图标就代表安装成功

2.Window——Preferences——Google——App Engine——Add(添加②)

3.Window——Preferences——Google——Web Toolkit——Add(添加③)


二.GWT____RPC(前后台交互)

①服务接口(必须继承RemoteServive,自定义RPC方法,必须以Service结尾)

②服务接口实现类(必须继承RemoteServiceServlet,必须实现①并实现自定义方法,必须以ServiceImpl结尾)

③异步接口(必须返回void,方法参数中添加一个AsyncCallback<返回值>回调函数,必须以ServiceAsync结尾)

例:

    服务接口:

    public interface TestService extends RemoteServive{

        public String test();

    }

    服务接口实现类:

    public TestServiceImpl extends  RemoteServiceServlet implements TestService{

        public String test(){

            return "测试";

        }

    }

    异步接口:

    public interface TestServiceAsy{

        public void test(AsyncCallback<String> async);

    }

猜你喜欢

转载自blog.csdn.net/qq_39652227/article/details/81707754
GWT
今日推荐