cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: JAXRS Handler modifying destination URI
Date Mon, 03 Aug 2009 19:26:03 GMT

I haven't looked into the JAX-RS stuff enough to know if there is a "pure JAX-
RS" way to do this.   With CXF, you should be able to register a CXF 
interceptor on the incoming interceptor chain that grabs the information from 
the Message and modifies it.   If it's registered really early in the chain, 
like USER_STREAM phase, it would run before any of our JAX-RS stuff.    
Probably something like:

String s = m.get(Message.REQUEST_URI);
s += "/data/" + date;
m.put(Message.REQUEST_URI, s);

Dan


On Mon August 3 2009 1:22:42 pm Sebastian Gomez wrote:
> Hi everyone.
> I'd like to implement a Handler that will modify the destination URI of the
> request appending some modifiers to it, eg. the current date. I'd like this
> being done in the handler, not in the method. I've been looking through the
> documentation and source code but I haven't found anything similar, so I'd
> like to know if something like what I need is possible. If not, is there
> some kind of workaround to obtain a similar result?
>
> In other words, I'd like my client calling /id/1 and have a method
> annotated with @Path("/id/1/date/{date}") to be able to get the date from
> the {date} variable.
>
> Hope someone can help. Thanks in advance.
>
> Sebastian Gomez

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message