1.获取请求host
StringBuffer url = request.getRequestURL();
String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).toString();
2.获取静态页的相对路径
String path=request.getSession().getServletContext().getRealPath("相对路径");