Home > Back-end >  Abnormal IDEA TOMCAT instantiating servlet class
Abnormal IDEA TOMCAT instantiating servlet class

Time:09-24

IDEA + tomcat can normally access the JSP page, jump the servlet error instantiating servlet class is unusual, refresh the page error HTTP Status 404 - was not found, please guide



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 The users=service. The.findall ();
//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 {

}
}
  • Related