开发者

How to get URL of a running app inside ServletContextListener?

开发者 https://www.devze.com 2023-03-24 13:38 出处:网络
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 u

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消