tags:

views:

99

answers:

1

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

Thanks in advance.

A: 

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!

JP