GWT Dynamic loading using GWT.create() with String literals instead of Class literals

后端 未结 9 1214
一个人的身影
一个人的身影 2020-12-14 10:11

GWT.create() is the reflection equivalent in GWT, But it take only class literals, not fully qualified String for the Class name. How do i dynamically create classes with

9条回答
  •  再見小時候
    2020-12-14 10:45

    Brian,

    The problem is GWT.create doen't know how to pick up the right implementation for your abstract class

    I had the similar problem with the new GWT MVP coding style ( see GWT MVP documentation )

    When I called:

    ClientFactory clientFactory = GWT.create(ClientFactory.class);

    I was getting the same error:

    Deferred binding result type 'com.test.mywebapp.client.ClientFactory' should not be abstract

    All I had to do was to go add the following lines to my MyWebapp.gwt.xml file:

    
        
        
        
    

    Then it works like a charm

提交回复
热议问题