//得到servlet或者action的访问路径,真实路径视具体而定
StringBuffer requestURL = request.getRequestURL();//http://localhost:8080/Hello/MusicService
String requestURLwithDomainName = requestURL.substring(0,requestURL.lastIndexOf("/"));//http://localhost:8080/Hello
servlet或struts得到带域名路径
最新推荐文章于 2023-04-11 11:44:04 发布