java获取请求url中的内容

HttpServletRequest httpRequest = (HttpServletRequest) request;
String strBackUrl = "http://" + request.getServerName() // 服务器地址
+ ":" + request.getServerPort() // 端口号
+ httpRequest.getContextPath() // 项目名称
+ httpRequest.getServletPath() // 请求页面或其他地址
+ "?" + (httpRequest.getQueryString()); // 参数
发布了64 篇原创文章 · 获赞 9 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/eadela/article/details/78788476
今日推荐