GWT RequestFactory 返回错误类型的对象
当我调用获取 TripImportSummaryProxy
对象列表时,我得到以下列表: com.schedgy.core.dao.filter.proxy.FilterProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory
。
@ProxyFor(value=TripImportSummary.class, locator=TripImportSummaryLocator.class)
public interface TripImportSummaryProxy extends MyBaseProxy {
// some setter/getters defined here
}
public interface TripImportSummaryRequestFactory extends RequestFactory, HasPaginationRequest<TripImportSummaryProxy> {
TripImportSummaryRequest request();
}
@Service(value=TripImportSummaryService.class, locator=MyServiceLocator.class)
public interface TripImportSummaryRequest extends RequestContext, PaginationRequest<TripImportSummaryProxy> {
}
@SkipInterfaceValidation
public interface HasPaginationRequest<T> extends RequestFactory {
PaginationRequest<T> request();
}
@ExtraTypes(FilterProxy.class)
@SkipInterfaceValidation
public interface PaginationRequest<T> extends RequestContext {
Request<List<T>> paginate(int offset, int limit, String sortColumn,
boolean isSortAscending, List<FilterProxy> filters);
Request<Integer> count(List<FilterProxy> list);
}
这都是通过以下方式执行的:
PaginationRequest<TripImportSummaryProxy> request = requestFactory.request();
request.paginate(offset, limit, sortColumn, isSortAscending, getFilters(request)).with(getPaths()).fire(new MyReceiver<List<TripImportSummaryProxy>>() {
@Override
public void onSuccess(List<TripImportSummaryProxy> response) {
// Response is a list of type that seems to extend from FilterProxy
}
});
FilterProxy 只是各种过滤器接口扩展的标记接口。
@ProxyFor(Object.class)
public interface FilterProxy extends ValueProxy {
}
我还有大约两打其他请求正在工作,但唯一失败的是这个。我已验证服务器端服务是否正确获取并返回正确的数据。我发现 TripImportSummaryLocator 类从未实例化,即使它似乎正确绑定到代理类型并且具有默认构造函数。
When I make a call to fetch a list of TripImportSummaryProxy
objects, I get back a list of:com.schedgy.core.dao.filter.proxy.FilterProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory
.
@ProxyFor(value=TripImportSummary.class, locator=TripImportSummaryLocator.class)
public interface TripImportSummaryProxy extends MyBaseProxy {
// some setter/getters defined here
}
public interface TripImportSummaryRequestFactory extends RequestFactory, HasPaginationRequest<TripImportSummaryProxy> {
TripImportSummaryRequest request();
}
@Service(value=TripImportSummaryService.class, locator=MyServiceLocator.class)
public interface TripImportSummaryRequest extends RequestContext, PaginationRequest<TripImportSummaryProxy> {
}
@SkipInterfaceValidation
public interface HasPaginationRequest<T> extends RequestFactory {
PaginationRequest<T> request();
}
@ExtraTypes(FilterProxy.class)
@SkipInterfaceValidation
public interface PaginationRequest<T> extends RequestContext {
Request<List<T>> paginate(int offset, int limit, String sortColumn,
boolean isSortAscending, List<FilterProxy> filters);
Request<Integer> count(List<FilterProxy> list);
}
This is all executed via:
PaginationRequest<TripImportSummaryProxy> request = requestFactory.request();
request.paginate(offset, limit, sortColumn, isSortAscending, getFilters(request)).with(getPaths()).fire(new MyReceiver<List<TripImportSummaryProxy>>() {
@Override
public void onSuccess(List<TripImportSummaryProxy> response) {
// Response is a list of type that seems to extend from FilterProxy
}
});
FilterProxy is just a marker interface that various filter interfaces extend.
@ProxyFor(Object.class)
public interface FilterProxy extends ValueProxy {
}
I have about two dozen other requests working and its only failing on this one. I have verified that the server side service is correctly fetching and returning the right data. I have found that the TripImportSummaryLocator class is never instantiated even though it appears to be bound to the proxy type correctly and has a default constructor.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的是 GWT 2.4 rc1,升级到 GWT 2.4 stable 后,我不再看到这个问题。
I was using GWT 2.4 rc1 and after upgrading to GWT 2.4 stable I am no longer seeing this problem.