John Lister
2012-01-07 17:31:02 UTC
I may have missed the answer to this, but is it possible to have managed
sub-resources such that I can inject beans, db resource, etc into them.
For example if I have
@Path("/child/")
Child getChild(){
return new Child();
}
then I have to either pass all the dependant resources as parameters or
make them visible to the child class so that they can be accessed from
it. The only way I can see is to make the child a bean and inject it
into the parent and return the injected object, the downside is the
extra object creation for every call.
Is there an alternative, how does everyone else do it?
Thanks
sub-resources such that I can inject beans, db resource, etc into them.
For example if I have
@Path("/child/")
Child getChild(){
return new Child();
}
then I have to either pass all the dependant resources as parameters or
make them visible to the child class so that they can be accessed from
it. The only way I can see is to make the child a bean and inject it
into the parent and return the injected object, the downside is the
extra object creation for every call.
Is there an alternative, how does everyone else do it?
Thanks
--
www.pricegoblin.co.uk
www.pricegoblin.co.uk