用request.getRequestURI();来获取!

解决方案 »

  1.   

    getRequestURI得到的是请求的目标地址,
    这样取到的是我这个计数器的地址,没法知道是从哪里发出的请求。
      

  2.   

    这是我用测试的WebServer收到的HTTP请求,就是取到其中的Refer的值就可以!有没有现成的API?GET /test.htm HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shock
    wave-flash, application/msword, application/vnd.ms-powerpoint, application/vnd.m
    s-excel, */*
    Referer: http://127.0.0.1:9099/test.htm
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
    Host: 127.0.0.1:9999
    Connection: Keep-Alive
      

  3.   

    晚了一步,有空看看这些东西。
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
      

  4.   

    request.getHeader("referer");应该可以,再请教高手:各版本的IE请求里面都能得到Refer键么?