【发布时间】:2013-11-05 02:15:27
【问题描述】:
我有两个应用程序部署在一个 JBoss 容器(同一个 unix 盒子)中。如果我收到来自 app1 的请求,我需要为 app2 发送相应的请求。
示例:如果 app1 请求:http://example.com/context?param1=123,
然后我需要提取http://example.com/,以便我可以发送第二个应用的请求。
我尝试过使用
HttpServletRequest.getServerName() &
HttpServletRequest.getServerPort() & \
HttpServletRequest.getHeader("host")
但我如何区分http 或https?
【问题讨论】:
标签: java http servlets http-headers httprequest