Hi,
On 22/11/11 16:23, Pat Turner wrote:
Hi Sergey,

ok, that's where I was up to: Using a Spring injected component as a
sub-resource locator, and passing path/query params through at method level.

This isn't a problem and is definitely workable, but I don't think its as
clean as using injected field, annotated with @PathParam.

FYI, I just don't get the parameter injected at all, so thread safety
doesn't even come into it :-( The Spring injected resource seems to have
been bypassed by CXF entirely. Is that right?

Actually, if @PathParam annotated fields are not thread safe for Spring
injected resources, why is it thread safe for 'normal' root resources.


Injecting @PathParam into fields is only thread-safe for per-request root resources, those created per every new request. Can you let me know please, how often an injected BusResource is created (the one which is injected into FleetResource), say by adding a println in its default constructor ? Does it happen on every request ?


Cheers, Sergey

I'm still unclear as to why it should be a problem for CXF to 'lookup'
resources, but I really appreciate your help on it.



Cheers
Pat



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Injecting-jax-rs-PathParam-into-sub-resource-fields-tp5013364p5014021.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to