request.getContextPath(); //动态返回当前项目映射的路径,且返回结果前自带“/” 例:当前项目名为 Servlet07 request.getContextPath(); —> /Servlet07 ① ② ③