请求中的 GWT RequestContext Enum
如果我们使用 enum 作为 Request 调用中的属性之一,它会抛出 UnsupportedOpeationException 并且甚至不会调用服务器上的服务方法。
@Service(value = DesignService.class, locator = DesignServiceLocator.class)
public interface DesignRequest extends RequestContext {
Request<List<DesignProxy>> findDesign(SortEnum sortorder);
}
当我们调用 designRequest.findDesign(sortorderEnum).fire() 时,UnsupportOperationException 会在 chrome 开发工具/Firebug 控制台的 javascript 控制台上抛出。
If we use enum as one of the attribute in the Request invocation , it throws an UnsupportedOpeationException and does not even invoke the service method on the server.
@Service(value = DesignService.class, locator = DesignServiceLocator.class)
public interface DesignRequest extends RequestContext {
Request<List<DesignProxy>> findDesign(SortEnum sortorder);
}
when we invoke the designRequest.findDesign(sortorderEnum).fire() the UnsupportOperationException is thrown on the javascript console on chrome dev tools/Firebug console.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它似乎与问题 6504 有关,如果无法找到您正在使用的类型,则会抛出
UnsupportedOperationException
- 考虑尝试更改为枚举中的类方法,或者等到 2.4 发布。如果您没有使用匿名枚举实例,您可以发布有关此错误的更多信息,例如异常从哪里抛出?
Looks like it is related to Issue 6504, which will throw an
UnsupportedOperationException
if it fails to find the type you are using - consider trying to change to class methods in your enum, or wait until 2.4 is released.If you are not using anonymous enum instances, can you post more info about this error, such as where the exception is thrown from?