How can I get access to the Application's Router instance from my ServerResource class? Is it even possible?
Thanks in advance.
I'm not sure how I didn't find the answer to this when I asked the question... but it's pretty straightforward. In your "doInit" method you can do something like this:
Router myRouter = (Router)this.getApplication.getRoot();
Very simple!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.