开发者

How can I override the CXF services list URL?

My webservice has an REST endpoint URL like /myapp/admin/services. If I set org.apache.cxf.servlet.hide-service-list-page=false then my URL is hijacked by the CXF services list. This happens because the listings URL is relative in org.apache.cxf.transport.servlet.ServletController.

OK, fine, so I shouldn't have used the phrase "services" in my URL structure. Mea culpa. But now how do I fix this? I'd like to override the "/services" default in ServletController. I just need my container to invoke setServiceListRelativePath() on that class, but I can't figure out 开发者_如何学运维how. I imagine there's some magic Spring snippet to do this?

If it matters, I'm using CXF as bundled in the Talend Service Factory.


(turning my comment above into an answer, and modernizing since TSF no longer exists)

Under Karaf, add the following to etc/org.apache.cxf.osgi.cfg: "org.apache.cxf.servlet.service-list-path=/desired/path"


You can try this in your web.xml to override the CXF service list path

<init-param>
  <param-name>service-list-path</param-name>
  <param-value>/*</param-value>
</init-param>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜