zoukankan      html  css  js  c++  java
  • 获取网站访问来源URL

    request.getHeader("HTTP_REFERER");

    or request.getHeader("referer");都可以

    可以将获取的URL插入到数据库,以便进行数据挖掘

    HTTP1.1规范中的描述
    14.36 Referer

       The Referer[sic] request-header field allows the client to specify,
       for the server's benefit, the address (URI) of the resource from
       which the Request-URI was obtained (the "referrer", although the
       header field is misspelled.) The Referer request-header allows a
       server to generate lists of back-links to resources for interest,
       logging, optimized caching, etc. It also allows obsolete or mistyped
       links to be traced for maintenance. The Referer field MUST NOT be
       sent if the Request-URI was obtained from a source that does not have
       its own URI, such as input from the user keyboard.

           Referer        = "Referer" ":" ( absoluteURI | relativeURI )

       Example:

           Referer: http://www.w3.org/hypertext/DataSources/Overview.html

       If the field value is a relative URI, it SHOULD be interpreted
       relative to the Request-URI. The URI MUST NOT include a fragment. See
       section 15.1.3 for security considerations.

    成长的乐趣,在于分享!
    大龄程序员,一路走来,感慨颇多。闲暇时写写字,希望能给同行人一点帮助。
    本文版权归作者growithus和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    将文件放到Android模拟器的SD卡中的两种解决方法
    Response JSON数据返回
    jAVA 得到Map价值
    【动态规划】leetcode
    思考互联网分布式系统
    Cocos2d-x数据持久-变更数据
    小程序猿都找到了工作经验的方式
    抄360于Launcher浮动窗口的屏幕显示内存使用情况(改进版)
    vb.net窗口继承(房重建知识汇总)
    Spring该讲座
  • 原文地址:https://www.cnblogs.com/growithus/p/11012584.html
Copyright © 2011-2022 走看看