ITeye博客

JEE中上下文地址的获取path && basePath

yianpuodiaotu · 2010-10-22 17:00 · JEE · Web前端 · Markdown

String path = request.getContextPath();
String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort() + path + "/";

结果:

/tasklist-ies

 

http://localhost:8080/tasklist-ies/

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。