没有可用于类型的源代码。您是否忘记继承所需的模块

Zai*_*nis 3 java gwt rpc

对不起我的英语我有一个 GWT 项目。我不会在客户端使用服务器类。

我有返回对象“Route”的 RPC 服务

@RemoteServiceRelativePath("springGwtServices/RouteService")
public interface IRouteService extends RemoteService {
    public ArrayList<Route> searchRoutes(String from, String to);
}
Run Code Online (Sandbox Code Playgroud)

但我不能在客户端使用这个类。当我尝试导入它时,出现异常“路由无法解析为类型” 我可以在服务器上使用此类吗?如果我不能,我必须做什么?ps 我将所有需要的类放入共享文件夹并得到异常

No source code is available for type project.shared.Route; did you forget to inherit a required module
Run Code Online (Sandbox Code Playgroud)

Sur*_*tta 5

将有一个名为的包shared,您可以在服务器端和客户端上使用这些类。

server您不能在客户端使用打包的类。

在将某些东西放入共享包之前要小心。阅读《GWT - 在共享文件夹中放置什么?》