我的工程在Project文件夹下,index.jsp在Project/index.jsp,servlet在文件夹Project/servlet下。在servet中用this.getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);可以转到http://localhost:8080/Project/index.jsp,但用response.sendRedirect("/index.jsp");却转到http://localhost:8080/index.jsp各位请指点一下!不能用response.sendRedirect("Project/index.jsp");因为在发布后路径就改了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货