Hi On Sun, Jul 18, 2010 at 9:19 PM, cfineman <[email protected]> wrote:
> > Say I wanted to write a ParameterHandler that was locale-sensitive (e.g. > for > parsing dates or monetary values). I can access to the request's locale via > an injected MessageContext but there's no obvious (to me!) way for me to > get > at the MessageContext from within the ParameterHanlder. I understand from > my > travels that the MessageContext is actually stored in a thread-local > variable... can I get access to that value without creating a dependency > that will likely break in future releases. > > I could write a spring interceptor to squirrel away the servlet request but > At the moment ParameterHandlers can not be injected with contexts, but there is another CXF specific way : Message m = PhaseInterceptorChain.getCurrentMessage(); Map<String, List<String>> headers = (Map) m.get(Message.PROTOCOL_HEADERS); or even HttpHeades headers = new HttpHeadersImpl(m); which is unlikely to break in the future cheers, Sergey > I was hoping to do it entirely via CXF's framework. Any thoughts? > -- > View this message in context: > http://cxf.547215.n5.nabble.com/Access-to-Locale-MessageContext-in-ParameterHandler-tp1431382p1431382.html > Sent from the cxf-user mailing list archive at Nabble.com. >
