执行多个GWT模块时处理RPC [英] Dealing with RPC when doing multiple GWT modules

查看:56
本文介绍了执行多个GWT模块时处理RPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对gwt应用程序进行了一些重构,并使其成为多个模块(即多个* .gwt.xml和EntryPoint)

I did some refactoring of my gwt application, and make it multiple modules (i.e. multiple *.gwt.xml and EntryPoint)

除RPC之外,其他所有功能似乎都可以正常工作.由于我重构了应用程序,因此从单个mygwtapp.gwt.xml到多个gwt.xml文件:

Everything seems to work fine, except for the RPC. Since I refactored the application, from a single mygwtapp.gwt.xml into multiple gwt.xml files:

main.gwt.xml
user.gwt.xml
login.gwt.xml 

以此类推...

我必须从以下位置更改servlet映射URL模式:

I had to change the servlet mapping URL-pattern from:

/mygwtapp/someRPC

插入/main/someRPC以确保RPC对主模块有效.它适用于主模块,不适用于其他模块.由于每个模块都相对于其模块名称(例如/user/someRPC

into /main/someRPC to make sure that RPC's will work for the main module. It works for the main module but not for the other modules. As each module is excepting to have RPC call relative to its module name like /user/someRPC

这种情况下的解决方法是什么?

What is the work-around for this kind of scenario?

推荐答案

您必须选择使用setServiceEntryPoint()并设置绝对路径("/main/someRpc")或使用@RemoteServiceRelativePath,但将路径设置为("../main/someRpc"):)

you have to options, either to use setServiceEntryPoint() and set the absolute path ("/main/someRpc") or use @RemoteServiceRelativePath but set the path to ("../main/someRpc") :)

这篇关于执行多个GWT模块时处理RPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆