我知道查询字符串是 URL 的一部分,后跟“?” 分离字符。我正在浏览一个示例代码。我不明白这行代码的目的 -
String urlString = request.getRequestURL().toString();
String queryString = request.getQueryString();
urlString += queryString == null ? "" : "?" + queryString;
// HOWS DOES THIS APPEND THE URL AND QUERY TO GENERATE URL. AND WHAT IS IT COMPARING TO NULL?
URL url = 新 URL(urlString);