java 获取URL

String url=request.getScheme()+"://";   
       url+=request.getHeader("host");   
       url+=request.getRequestURI();   
       if(request.getQueryString()!=null)   
          url+="?"+request.getQueryString();   
       System. out.println(url); 

你可能感兴趣的:(java 获取URL)