GWT +请求工厂+ RequestContext 重载验证
我遇到了有关请求上下文超载的问题。
我有以下问题:
public interface TaskAssignmentRequest extends RequestContext {
.
.
.
Request<List<TaskAssignmentProxy>> findTaskAssignmentByProjectIds(List<String> id);
Request<List<TaskAssignmentProxy>> findTaskAssignmentByProjectIds(List<String> id, Date start_date, Date end_date);
运行代码时出现以下错误
SEVERE: Method overloads found in type com.abc.server.TaskAssignmentService named findTaskAssignmentByProjectId:
java.util.List findTaskAssignmentByProjectId(java.lang.String java.util.Date java.util.Date )
java.util.List findTaskAssignmentByProjectId(java.lang.String )
在这种情况下不允许重载吗?我不明白为什么不。
谢谢,
纳丁
I am having issues with regarding the overloading of the Request Context.
I have the following:
public interface TaskAssignmentRequest extends RequestContext {
.
.
.
Request<List<TaskAssignmentProxy>> findTaskAssignmentByProjectIds(List<String> id);
Request<List<TaskAssignmentProxy>> findTaskAssignmentByProjectIds(List<String> id, Date start_date, Date end_date);
I am getting the following errors when I am running my code
SEVERE: Method overloads found in type com.abc.server.TaskAssignmentService named findTaskAssignmentByProjectId:
java.util.List findTaskAssignmentByProjectId(java.lang.String java.util.Date java.util.Date )
java.util.List findTaskAssignmentByProjectId(java.lang.String )
Is overloading not allowed in this case? I do not see why not.
Thanks,
Nadin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RequestFactory 目前(从 GWT 2.2 开始)不支持服务 API 中的方法重载。
RequestFactory doesn't currently (as of GWT 2.2) support method overloads in service APIs.
当它寻找带有
List
参数的方法时,这些是它能找到的唯一方法吗?您列出的方法只有一个纯字符串作为第一个参数。Could it be that those are the only methods it could find, when it's looking for the methods with the
List<String>
parameter? The methods you've listed just have a plain String for the first parameter.