0

I'm trying to work with servlets, so I created a Java EE project on a Tomcat server. As you can see below, I have an environment variable JAVA_HOME, which holds the path to JDK 10. The Java version also defaults to 10, however when I start my Tomcat server, I get the highlighted error.

enter image description here

The problem arose after I created a servlet and tried to map it like in the screenshot below.

enter image description here

enter image description here

In my project I also use the 10th version of Java. I don't quite get what the problem is here, so any hint would help.

P.S.: similar questions like this one did not solve my problem

Hidayat Rzayev
  • 339
  • 3
  • 14

1 Answers1

1

The URL pattern must start with a /.

Replace

<url-pattern>add</url-pattern>

with

<url-pattern>/add</url-pattern>
Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110