Provide seamless support for local.server.port

Previously, the actual HTTP port on which a web application is running on
was only exposed in tests. This commit makes sure to provide that feature
regardless of the environment so that applications can know on which port
they are actually running on.

If there are several containers, each is exposed via the namespace of
their respective application context.

Closes gh-3259
This commit is contained in:
Stephane Nicoll
2015-06-04 17:35:09 +02:00
parent cb98ee25ff
commit c177a774a5
7 changed files with 44 additions and 11 deletions

View File

@@ -400,6 +400,9 @@ code.
=== Use a random unassigned HTTP port
To scan for a free port (using OS natives to prevent clashes) use `server.port=0`.
TIP: You can know what port got allocated at runtime by looking at the `local.server.port`
property in the `Environment`.
[[howto-discover-the-http-port-at-runtime]]