spring mvc中获取请求URL
String baseUrl=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort+request.getContextPath()+"/";
得到形如http://www.baidu.com:8080/xxx
从HttpServletRequest获取:
request.getRemoteAddr()获取ip
request.getRemotePort()获取端口号
request.getServletPath()获取请求地址