My Tomcat v9.0 server can not run a servlet listener clas despite correct xml file

214 views Asked by At

Tomcat server could not find the servlet class. Even I tried only with a servlet class. Still, the server could not find the servlet class, giving the same error message. I am very new to web application.

This the web.xml file This is error message This is my servlet file.servlet

This is my listener file.listener

This is my expected output. If I put manually the link: http://localhost:8081/listener_Demo/TestServlet, I get it on console (look at console).expected output

1

There are 1 answers

6
Anish B. On

Update welcome-file-list and add your custom jsp to open directly.

for example :

<welcome-file-list>
   <welcome-file>display.jsp</welcome-file>
</welcome-file-list>

Now, you can use http://localhost:8081/listener_Demo/ to open directly your page.

Note you have to keep the .jsp in the root WEB-INF folder for accessing.