Answer the question
In order to leave comments, you need to log in
Servlet won't start... What's wrong?
In general, here is the project ... It was launched before the norms, a couple of months passed, I changed Windows, I decided to continue my studies and my amateur performance ... but even the servlet does not want me to write the data that is transferred to the database ... not to mention the display of the same data...
https://github.com/Dron73/Guest_book
Answer the question
In order to leave comments, you need to log in
he then deploys it, displays a jsp page ... the servlet with methods for adding and deleting does not want for some reason ... I have now commented out everything related to the database, and simply output the string through the printwriter ... But with the methods, he swears at DBWorker class, namely Class.forName("org.postgresql.Driver");
it is not clear why only the postgresql driver is connected to the project. I tried to make another project with a database, where data insertion and data return work as it should. It's about the servlet...
First you need to make sure that Tomcat deploys the application. To do this:
1. Add to the servlet <load-on-startup>1</load-on-startup>
in web.xml
2. Add a method to the servlet
public void init(ServletConfig config) throws ServletException {
LOG.info("Initialized");
}
switch to the modern standard, where
it is possible to completely do without declarations in web.xml
for example,
in the servlet you write:
@WebServlet(
name = "LoginUser",
description = "Вход пользователя - проверка имени пользователя и пароля",
urlPatterns = "/LoginUser"
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question