Hi
On 26/04/12 17:04, rouble wrote:
Hi All,
I have an API coded as:
@GET
@Path("/item/{id:.*}")
Customer readItem(@PathParam("id")AbstractID itemPkid);
I am assuming this means that the id path param includes all characters in
the GET request after /item/.
And then I have ParameterHandler as follows:
public class AbstractIDHandler implements ParameterHandler<AbstractID> {
public AbstractID fromString(String s) {
logger.info("String is " + s);
return new AbstractIDStr(s);
}
}
Now when the API is called with:
http://example.com/item/1/type/int
I expect the string passed in to the ParamterHandler.fromString(String) to
be the "1/anything/here". But the String passed in is just "1". Is that
right or is this a bug?
I can not reproduce it, the URITemplate test reports "1/type/int" for a
matching id and the other updated local test works OK too, meaning a
custom ParameterHandler gets "1/type/int".
What is the version of CXF in your case ?
Can you get me a simple Maven based test project ?
Cheers, Sergey
Basically, I have a case where multiple path parameters translate to one
API parameter. I can define the path as I like, but I can't change the API.
So, something like:
http://example.com/item/1/type/int
OR
http://example.com/item/1?type=int
I need both the item id and the type to create the itemPkid. Any thoughts?
tia,
rouble
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com