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

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

结果:

/tasklist-ies

 

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

你可能感兴趣的:(Path)