litesoft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package org.hanson.gwt.client;
import com.google.gwt.core.client.*;
import com.google.gwt.user.client.rpc.*;
import com.google.gwt.user.client.ui.*;
public class MyApplication implements EntryPoint
{
@Override
public void onModuleLoad()
{
// define the service you want to call
MyServiceAsync svc = (MyServiceAsync) GWT.create( MyService.class );
ServiceDefTarget endpoint = (ServiceDefTarget) svc;
endpoint.setServiceEntryPoint( "MyService" );
// define a handler for what to do when the
// service returns a result
AsyncCallback callback = new AsyncCallback()
{
@Override
public void onSuccess( Object result )
{
RootPanel.get().add( new HTML( result.toString() ) );
}
@Override
public void onFailure( Throwable ex )
{
RootPanel.get().add( new HTML( ex.toString() ) );
}
};
// execute the service
svc.myMethod( "Do Stuff", callback );
}
}
|
Revision |
Author |
Commited |
Message |
162
|
GeorgeS
|
Fri 01 Apr, 2011 19:58:40 +0000 |
|