Hi all,

I have a problem when developing a program to test delay-RPC, running
on Chrome.

My program is very simple, client side sends a RPC request to server
to get a string to display a count number. Server delays 1 second
before sending back the count string.

The program works well with hosted browser and IE (version 8).
However, when I
test it on Chrome (version 3.0.195.27) I see problems as following:

- Chrome always displays waiting/loading status (glasshour mouse
pointer and
loading icon on the tab). However the counter still works correctly

- If I press Esc keyboard button, Chrome stops that loading status
but the counter stops working too.

Can someone help me to find what I am missing?

Thank you a lot in advance.


The code is bellow (I am using Eclipse). I also upload this program
into GAE so you can test it easily. The link is http://gwtman.appspot.com/.


-------------------------------------------
File TestMsg .java
package com.mysite.testmsg.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

public class TestMsg implements EntryPoint {
        private final MyServiceAsync eventService = GWT.create
(MyService.class);
        Label label = new Label("Count: 0");
        private class GetEventsCallback implements AsyncCallback{
                public void onFailure(Throwable throwable){ GWT.log
("Error get events", throwable); }
                public void onSuccess(Object obj){
                        String str = (String)obj;
                        label.setText(str);
                        eventService.getEvent( this );
                }
        }
        public void onModuleLoad() {
                RootPanel.get().add(label);
                eventService.getEvent( new GetEventsCallback() );
        }
}

-------------------------------------------
File MyService .java
package com.mysite.testmsg.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@RemoteServiceRelativePath("myservice")
public interface MyService extends RemoteService {
        String getEvent();
}

-------------------------------------------
File MyServiceAsync.java
package com.mysite.testmsg.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
public interface MyServiceAsync {
        void getEvent(AsyncCallback<String> callback);
}

-------------------------------------------
File MyServiceImpl .java
package com.mysite.testmsg.server;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.mysite.testmsg.client.MyService;
@SuppressWarnings("serial")
public class MyServiceImpl extends RemoteServiceServlet implements
MyService {
        static int count = 0;
        public String getEvent() {
                try{
                        synchronized( this ){
                                this.wait( 1*1000 );
                        }
                }
                catch (InterruptedException ignored){}
                count++;
                return "Count: "+count;
        }
}

-------------------------------------------
File web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
  <servlet>
    <servlet-name>myServlet</servlet-name>
    <servlet-class>com.mysite.testmsg.server.MyServiceImpl</servlet-
class>
  </servlet>
  <servlet-mapping>
    <servlet-name>myServlet</servlet-name>
    <url-pattern>/testmsg/myservice</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>TestMsg.html</welcome-file>
  </welcome-file-list>
</web-app>
-------------------------------------------
File TestMsg.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='testmsg'>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class='com.mysite.testmsg.client.TestMsg'/>
</module>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to