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
The server port number doesn't exist. It can have any number of port numbers. So what you're asking doesn't make sense. The port number associated with a specific request does make sense.