拼写网站路径

public String getPath() {
int port = request().getServerPort();
String portStr = "";
if(port != 80){
portStr = ":"+port;
}
String path = request().getScheme() + "://" + request().getServerName()
+ portStr + request().getContextPath()
+ "/";
return path;
}

protected HttpServletRequest request(){
return ServletActionContext.getRequest();
}
posted @ 2016-01-13 12:16  我是谁呢  阅读(156)  评论(0编辑  收藏  举报