Java中获得完整的URl字符串

Java中获得完整的URl字符串

HttpServletRequest httpRequest=(HttpServletRequest)request;  

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

转自:(http://blog.csdn.net/del1214/article/details/6538189)

你可能感兴趣的:(JAVA)