标签:
web工程中各类地址,最好以/开头开始前先想好:地址是给谁用的
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //1,地址是给服务器用的 request.getRequestDispatcher("/foot.jsp").forward(request,response); //2,地址是给浏览器用的 response.sendRedirect("/day06/foot.jsp"); //3,服务器 this.getServletContext().getRealPath("/foot.jsp"); //4,服务器 this.getServletContext().getResourceAsStream("/public/head.jsp"); //5,给浏览器 /* <a href="/day06/foot.jsp">xxxxx</a> <form action="/day06/head.jsp"></form> */ }
标签:
原文地址:http://www.cnblogs.com/lyjs/p/4890063.html