Is there any Tomcat API or configuration available which can tell an application (probably on startup), what port its running on without a request?
Imagine a scenari
If you want to access an application on the same server instance, just omit the server part of the URL. Some examples what you can achieve. The current document is at http://example.com:8080/app2/doc.html
xxx.html becomes http://example.com:8080/app2/xxx.html../xxx.html becomes http://example.com:8080/xxx.html../xxx.html becomes http://example.com:8080/xxx.html../foo/xxx.html becomes http://example.com:8080/foo/xxx.html../../xxx.html becomes http://example.com:8080/xxx.html (there is no way to go beyond the root)/xxx.html becomes http://example.com:8080/xxx.html This is probably what you look for.//other.com/xxx.html becomes http://example.com:8080/xxx.html Useful if you want to keep "https:"