//請求的URL app
String realURI = req.getRequestURI();ide
//項目的名,即http://localhost/appname/catelog/中的/appname String contextURI = this.getServletContext().getContextPath();this