java 获取请求的完整url地址

1 String url=request.getRequestURL()+"?"+request.getQueryString();

 

获取域名:如:http://www.test.com/

StringBuffer url = request.getRequestURL();  
String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString(); 



你可能感兴趣的:(java 获取请求的完整url地址)