Reputation: 105043
I'm inside ServletContextListener
, and need to get a URL of the application in full format, including protocol, server, port, and path. How can I do this?
Upvotes: 1
Views: 1002
Reputation: 310860
You can't because it isn't unique. The container could have any number of aliases; it could be listening to any number of ports; and it could be listening on any specific port either HTTP or HTTPS.
Upvotes: 1