如何获取请求的 URL?
我正在使用 Jeresy Jax-RS 构建 Web 服务。现在我需要获取带有端口 # 的请求的 url(如果存在)。
因此,如果我的服务在 http://www.somelocation.com/web/services 上运行,我想要捕获 www.somelocation.com
我该怎么做?
I am using Jeresy Jax-RS to build a web service. Now I need to get the url of the request with the port # if one exist.
So if my service runs on http://www.somelocation.com/web/services I want to capture the www.somelocation.com
How can I do this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 UriInfo 参数添加到您的操作中。从那里您可以访问 URL:
You can add a UriInfo parameter to your operation. From there you can access the URL: