I've two web applications with one RESTFul service each one. In a service I need to call the second, for example, I Have StatusService and SomeService, depending on state SomeService do some different action. So when I call SomeService its call StatusService to get the current state then do the action.
So, I used reques.getServerPort()
in my SomeService to call my StatusService, I have something like this
URL url = new URL("http://localhost:"+request.getServerPort()+"/app2/status");
It's working when I call the service directly from jboss .
But there are a Apache as a DMZ and only SomeService was externalized, so when I call SomeService via DMZ its try to call http://localhost:80/app2/status
rather then http://localhost:8080/app2/status
.
Is there another way to get the port?
Thanks in advance.