Update: I got it working. In the service I did:
Message m = PhaseInterceptorChain.getCurrentMessage(); m.get(XApp.class); 1) Is this the correct way of accessing data that has been put through a JAX-RS filter? 2) Why message context approach does not work? From debugging the code I ve seen that the instance of MessageContext in the Filter its different that the instance of MessageContext that its injected into the Service. Is this behavior correct. They both shouldnt be the same instance.? Many Thanks, On Tue, Jan 29, 2013 at 11:41 AM, Esteban Wagner <[email protected]>wrote: > Please note that also I have tried doing this in the request handler: > @Context MessageContext mc; > handleRequest(){ > > XApp xApp = new XApp() > > mc.put(XApp.class, xApp); > > > } > > > > On Tue, Jan 29, 2013 at 11:33 AM, Esteban Wagner <[email protected] > > wrote: > >> Hi, >> >> I am using a JAX-RS Filter to process some input and then I want to put >> an instance of an object available for the Service. >> >> So in the filter request handler method I am doing: >> XApp xApp = new XApp() >> >> message.put(XApp.class, xApp); >> >> >> And in the service in the target method i am doing: >> >> @Context MessageContext mc; >> XApp xApp = (XApp) mc.getXApp.class); >> >> >> The message context gets injected into the service but the object I put >> into the message its not there... >> >> What can be wrong here? >> >> >> Many Thanks, >> >> >> >> >> >> >> >
