0
点赞
收藏
分享

微信扫一扫

java查询所有

package com.yh.controller;

import com.yh.model.Customer;
import com.yh.service.CustomerService;
import com.yh.service.impl.CustomerServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "ShowAllServlet", value = "/ShowAllServlet")
public class ShowAllServlet extends ViewBaseServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        CustomerService customerService=new CustomerServiceImpl();
        List<Customer> customers = customerService.showAllCustomer();
        request.setAttribute("Consumer",customers);
        super.processTemplate("list",request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }
}

举报

相关推荐

0 条评论