2

I am using the following header in my web.xml

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">

I don't know what I am doing wrong but Idea is unable to suggest correct syntax for web.xml. I am getting the below.

enter image description here

I have the following in my pom.xml so I am sure the JAR file is correct.

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
</dependency>

I understand that the autocomplete should be working as per the XSD file. So is the XSD being used incorrect?

Aseem Bansal
  • 6,722
  • 13
  • 46
  • 84

1 Answers1

0

I think its your schema fault.Use following schema, it is working fine for me

<web-app version="2.4"
    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">![enter image description here][1]

screen shot