Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从我的 ServerResource 类访问应用程序的路由器实例?甚至可能吗?
提前致谢。
我不确定当我问这个问题时我怎么没有找到答案……但这很简单。在您的“doInit”方法中,您可以执行以下操作:
Router myRouter = (Router)this.getApplication.getRoot();
非常简单!