获取URL地址

时间:2010-05-18 07:27:26

标签: java url

每次在java中刷新页面时如何获取URL地址..? 我正在做的项目需要URL(域名),而每个页面都刷新.. !!

1 个答案:

答案 0 :(得分:1)

用户request对象获取网址

// Getting servlet request URL

String url = request.getRequestURL().toString();

// Getting servlet request query string.

String queryString = request.getQueryString();



// Getting request information without the hostname.

String uri = request.getRequestURI();