Subresouce and CDI Injection Issue
问题 I am new to jax-rs and i am stuck with subresources. Take a look. this is not working @Path(..) public class Test { @Path(...) public SubResource getSub(){ return new SubResource(); } } public class SubResource { @Inject private MyBean myBean; @GET public String getStr(){ return myBean.getStr(); // myBean is null, injection didnt work properly } this works, but why???? @Path(..) public class Test { @Context private ResourceContext context; @Path(...) public SubResource getSub(){ return