Java中获取完整的url

Java中获得完整的URl字符串

 HttpServletRequest httpRequest=(HttpServletRequest)request;  

 String strBackUrl = "http://" + request.getServerName() //服务器地址
+ ":"
+ request.getServerPort() //端口号
+ httpRequest.getContextPath() //项目名称
+ httpRequest.getServletPath() //请求页面或其他地址
+ "?" + (httpRequest.getQueryString()); //参数
上一篇:RMAN之进入RMAN(转)


下一篇:在Azure Cloud Service中部署Java Web App(1)