1.运行报错
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doGet(req, resp);
String name ="我的简易框架";
req.setAttribute("name",name);
RequestDispatcher requestDispatcher = req.getRequestDispatcher("/WEB-INF/jsp/hello.jsp");
requestDispatcher.forward(req,resp);
return;
}
}
2.原因是已经提交过,不可以重定向
3.注释
//super.doGet(req, resp);
4.测试ok