您的位置:首页 > 编程语言 > Java开发

Java获取完整URL

2008-04-23 12:23 435 查看
/** *//**

public String getBackUrl(javax.servlet.http.HttpServletRequest request) throws Exception {

String strBackUrl = "";

try {

strBackUrl = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + request.getServletPath() + "?" + this.codeToString(request.getQueryString());

strBackUrl = java.net.URLEncoder.encode(strBackUrl,"gbk");

} catch(Exception e) {

throw e;

}

return strBackUrl;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: