cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bohr qiu <qiubo...@gmail.com>
Subject Re: why path_info is contextPath + req.getPathInfo()
Date Mon, 25 Jul 2011 23:29:01 GMT
thanks your reply.i will create a patch.
在 2011-7-26 上午1:08,"Sergey Beryozkin" <sberyozkin@gmail.com>写道:
>
> Hi
>
>> hi,every body when i extends CXFServlet to dispacth request by http
header Content-Type,i found that in AbstractHTTPDestination#setupMessage
>> inMessage.put(Message.REQUEST_URI, req.getRequestURI());
>> inMessage.put(Message.PATH_INFO, contextPath + req.getPathInfo());
>>
>> the two statements above ,the first put Message.REQUEST_URI into
inMessage ,and the second put Message.PATH_INFO into inMessage,if my request
url is http://localhost:8080/cxf/ws/rest1/roomservice/room/12 and
 org.apache.cxf.request.uri=/cxf/ws/rest1/roomservice/room/12,
 org.apache.cxf.message.Message.PATH_INFO=/cxf/rest1/roomservice/room/12
>> why servlet-mapping "ws" is removed?
>
>
> I can see PATH_INFO is used by some CXF code, but the only reason it works
is because the code which relies upon it checks it againt Message.BASE_PATH
which also misses servletPath().
>
> Would you be interested in creating a patch ?
>
> Adding
>
> String contextServletPath = contextPath + req.getServletPath();
>        inMessage.put(Message.PATH_INFO, contextServletPath +
req.getPathInfo());
>
> instead of
>
> inMessage.put(Message.PATH_INFO, contextPath + req.getPathInfo());
>
> and also replacing few lines below
>
> String basePath = getBasePath(contextPath);
> with
> String basePath = getBasePath(contextServletPath);
>
> should do it.
>
> verify this fix if you can, otherwise please open a JIRA and we will look
into it...
>
> Cheers, Sergey
>
>
>
>
>>
>> 2011-07-23
>>
>>
>>
>> qiuboboy
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message