01.获取路径
02.获取资源流
03.获取路径下所有资源的路径
@Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //得到有盘符的路径 String path = getServletContext().getRealPath("/index.jsp"); System.out.println(path); //获取路径之后,创建输入流对象 InputStream input = getServletContext().getResourceAsStream("/index.jsp"); //获取当前路径下所有资源的路径 Set<String> paths = getServletContext().getResourcePaths("WEB-INF"); System.out.println(paths); }