My web.xml file is showing an error and I don't know why. When I go to the file it showing red x on line two on the word "<web-app". When I hover on the error it showing this message below.
Multiple annotations found at this line:
- cvc-complex-type.4: Attribute 'version' must appear on element 'web- app'.
- Attribute:
- version is required in element:
- web-app Code:
Here's the code for my web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID">
<display-name>springboot-server</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
In the problem tabe is showing two different errors is in the web.xml line two. The first type of error is Language Servers and the second type error is XML Problem.