0

I try to build a web application using java. The software that I have used Eclipse, mysql workbench, mysql connector/J, jdk-17.0.1. The environment variable that I have set are like

enter image description here

enter image description here

After that I followed How to Connect a MySQL Database to a Tomcat Server in Eclipse video tutorial upto 12:39 min to create a html and jsp page and run the server.

HTML page:

enter image description here

JSP page:

enter image description here

The error in the JSP page is Multiple annotations found at this line: - The superclass "jakarta.servlet.http.HttpServlet" was not found on the Java Build Path

- Line breakpoint:P_reg.jsp [line: 1]

Also if I start the server as directed in the video lecture I got the error

enter image description here

I tried to solve this error seeing How do I import the javax.servlet / jakarta.servlet API in my Eclipse project? link.

I went through this link as well. But nothing worked.

How can I fix this problem?

Encipher
  • 1,370
  • 1
  • 14
  • 31
  • 1
    You already have Tomcat, you do not need to do anything else to have the servlet APIs, in fact you shouldn't. Your 404 error likely has to do with your HTML file not being a filename listed in your `web.xml`'s list of welcome pages. – nitind Nov 22 '21 at 12:28
  • How could I enlist HTML im web.xml? Where can I find web.xml? – Encipher Nov 22 '21 at 13:03
  • 1
    **Navigate** > **Open Resource**. – nitind Nov 22 '21 at 15:22
  • Open Resource is an empty window. It has three sections - `Enter resource name prefix, path prefix, pattern`, `Matching items` , `Servers/Tomcat v8.5 Server at localhost-config`. What should I do there? – Encipher Nov 22 '21 at 19:56
  • Type the name of the file into the text field labelled, "Enter resource name prefix". – nitind Nov 22 '21 at 20:45

0 Answers0