The servlet code
Package the servlet;
import javax.servlet.ServletException;
The import javax.mail. Servlet. The annotation. WebServlet;
The import javax.mail. Servlet. HTTP. HttpServlet;
The import javax.mail. Servlet. HTTP. It;
The import javax.mail. Servlet. HTTP. HttpServletResponse;
import java.io.IOException;
import java.util.List;
The import domain. The User;
The import service. UserService;
The import service. UserServiceImpl;
@ WebServlet (name="/UserListServlet")
Public class UserListServlet extends the HttpServlet {
Protected void doPost (it request, HttpServletResponse response) throws ServletException, IOException {
//call vehService complete query
UserService service=new UserServiceImpl();
List
//will be credited to the request list domain
Request. SetAttribute (" users ", the users);
//forwarded to the list. The JSP
Request. GetRequestDispatcher ("/list JSP "). The forward (request, response);
}
Protected void doGet (it request, HttpServletResponse response) throws ServletException, IOException {
}
}