Update GetAllPrepServlet.java

pull/1/head
pght2c95q 8 months ago
parent f50c706a50
commit 2b4da0eb6b

@ -14,22 +14,31 @@ import com.cn.service.impl.PrepServiceImpl;
/**
*
* @ClassName: GetAllPrepServlet
* @Description:
* @ClassName: GetAllPrepServlet
* @Description:
* @author: ljy
* @date: 20191116 7:44:25
*/
public class GetAllPrepServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrepService prepService = new PrepServiceImpl();
List<Prep> prepList = prepService.getAll();
request.setAttribute("prepList", prepList);
request.getRequestDispatcher("pages/admin/right/prepCenter.jsp").forward(request, response);
}
}
private static final long serialVersionUID = 1L;
/**
* GET
* GET
* @param request HttpServletRequest
* @param response HttpServletResponse
* @throws ServletException Servlet
* @throws IOException IO
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 创建PrepService的实现类对象用于访问订单相关的业务逻辑
PrepService prepService = new PrepServiceImpl();
// 调用prepService的getAll方法获取所有订单的列表
List<Prep> prepList = prepService.getAll();
// 将订单列表设置为request的属性以便在JSP页面中可以访问
request.setAttribute("prepList", prepList);
// 使用RequestDispatcher将请求转发到指定的JSP页面
// "pages/admin/right/prepCenter.jsp"是JSP文件的路径用于展示所有订单信息
request.getRequestDispatcher("pages/admin/right/prepCenter.jsp").forward(request, response);
}
}
Loading…
Cancel
Save