servlet查询所有的语句

tech2024-11-21  22

public class QueryServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { goodsDao gd= new goodsDao(); //调取查询 //goods是一个实体类 //queall()是goodsdao里的方法 ArrayList<goods>list=gd.querAll(); //打包 req.setAttribute("list", list); //转发 req.getRequestDispatcher("index.jsp").forward(req,resp); } }`
最新回复(0)