On 10/01/2012, at 7:58 AM, John Lister wrote:
> On 19:59, Cameron Heavon-Jones wrote:
>> You may find that ResourceContext.getResource(Class) is what you are looking for. Here is a previous discussion: http://jersey.576304.n2.nabble.com/injecting-Context-fields-on-sub-resources-td4930958.html Thanks, Cam
> Cheers, missed that and looks ideal.. On a side note, the discussion also show resources extending a class like so:
>
> @Path("/blah/")
> class MyResource extends Base {
> ...
> }
>
> I was wondering if injection into Base now supported? For example this would allow a common base class to include stuff like references to an entity manager, etc rather than declaring it in every resource object.
>
> John
>
> --
> www.pricegoblin.co.uk
>
Yes i think that is supported, you should be able to add @Context annotations to interfaces and inherited methods too.
cam