java 如何获取以前的网址?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6994936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get previous URL?
提问by Johny T Koshy
I need the URL from which my web app is called. For eg:- If there is a link to my site foo.com from stackoverflow.com, I need the stackoverflow link in web app(managed bean).
我需要从中调用我的网络应用程序的 URL。例如:- 如果有一个从 stackoverflow.com 到我的站点 foo.com 的链接,我需要 web 应用程序(托管 bean)中的 stackoverflow 链接。
All helps appreciated, thanks.
所有帮助表示赞赏,谢谢。
回答by nfechner
回答by Deepansh Gupta
By checking the HTTP Referrer you can see from which site the request for your site originated.
通过检查 HTTP Referrer,您可以看到对您站点的请求来自哪个站点。