1,java类中字体MS Gothic
2,得到请求资源,例如,http://localhost:8080
public static URL serverURL(HttpServletRequest request) throws MalformedURLException { StringBuffer url = new StringBuffer(); String scheme = request.getScheme(); int port = request.getServerPort(); if (port < 0) port = 80; url.append(scheme); url.append("://"); url.append(request.getServerName()); if (scheme.equals("http") && port != 80 || scheme.equals("https") && port != 443) { url.append(‘:‘); url.append(port); } return new URL(url.toString()); }
时间: 2024-10-11 05:44:38