I have two applications deployed in a JBoss container (same unix box). If I receive a request from app1, I need to send a corresponding request for app2.
An Example: If app1 requests: http://example.com/context?param1=123
,
then I need to extract http://example.com/
, so that I can send the request for the second app.
I tried using
HttpServletRequest.getServerName() &
HttpServletRequest.getServerPort() & \
HttpServletRequest.getHeader("host")
but how can I destinguish between http
or https
?