I'm inside ServletContextListener
, and need t开发者_运维技巧o get a URL of the application in full format, including protocol, server, port, and path. How can I do this?
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.
精彩评论