Question

How can I get access to the Application's Router instance from my ServerResource class? Is it even possible?

Thanks in advance.

Was it helpful?

Solution

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top