Servlet路径问题

//请求的URL  

String realURI = req.getRequestURI();

//项目的名,即http://localhost/appname/catelog/中的/appname
String contextURI = this.getServletContext().getContextPath();

本文出自 “田书培” 博客,谢绝转载!

你可能感兴趣的:(servlet,职场,休闲)