当前位置: 技术问答>java相关
如何知道客户端是通过哪一个URL访问本页面的?急!!!
来源: 互联网 发布时间:2015-05-09
本文导语: 我用了request.getHeader("Referer"),但值为null,是参数错了吗??? | public static URL serverURL(/tech-qa-java/HttpServletRequest request/index.html) throws MalformedURLException { StringBuffer url = new StringBuffer(); String scheme ...
我用了request.getHeader("Referer"),但值为null,是参数错了吗???
|
public static URL serverURL(/tech-qa-java/HttpServletRequest request/index.html) throws MalformedURLException
{
StringBuffer url = new StringBuffer();
String scheme = request.getScheme();
int port = request.getServerPort();
if (port
{
StringBuffer url = new StringBuffer();
String scheme = request.getScheme();
int port = request.getServerPort();
if (port