每次在java中刷新页面时如何获取URL地址..? 我正在做的项目需要URL(域名),而每个页面都刷新.. !!
答案 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();