request.getRealPath("/")+request.getRequestURI

解决方案 »

  1.   

    getQueryString()是错误的 public java.lang.String getQueryString()
    Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.
      

  2.   

    request.getServerName() + ":" + request.getServerPort()
      

  3.   

    看看这个帖子
    http://www.asuslife.com/network/asp/jsp1-20010104-001.htm
      

  4.   

    试试这样:
    import java.net.*;    try
        {
          InetAddress Address = InetAddress.getLocalHost();
          String Addr = Address.getHostAddress();
          System.out.print(Addr);
        }
        catch(Exception e)
        {
          System.out.print(e.getMessage());
        }
      

  5.   

    getLocalhost();
    getHostAddress();