怎样从HttpServletRequest中得到完整的请求URL-JSP编程

2024-10-31 15:31:47
推荐回答(1个)
回答1:

现在给你解答
String getFullURL(HttpRequest request) {

StringBuffer url = request.getRequestURL();
if (request.getQueryString() != null) {
url.append(’?’);
url.append(request.getQueryString());
}
return url.toString();
}