Hi

Message currentMessage =    
org.apache.cxf.phase.PhaseInterceptorChain.getCurrentMessage();

I think it's safe to use this code. If it were possible for you to use jaxrs filters/invokers or cfx in interceptors sitting between JAXRSInInterceptor & application code then you'd get the Message being passed explicitly, but in your case using this thread-local call is probably the only option...

cheers, Sergey


Hi,

You should be able to get to a current message like this :

Message currentMessage =    
org.apache.cxf.phase.PhaseInterceptorChain.getCurrentMessage();
Next you can get to the actual HttpServletRequest like this 
:currentMessage.get("HTTP.REQUEST"); //
AbstractHttpDestination.HTTP_REQUESTYou might want to use the CXf JAX-RS 
URITemplate implementation which will help to extract the
keys :URITemplate t = new 
URITemplate("/rest/{key}/products/list");MultivaluedMap<String, String> map = new 
MetadataMap<String,
String>();t.match(relativeURI, map);map.get("key");
cheers, Sergey

Thank you, looks like this is what I really need. Is it a common way, or just
a "hack", which might not work in the next version of CXF?

--
Eugene N Dzhurinsky


Reply via email to