It should be located in the YOURPROJECT\web\WEB-INF folder, so the full path will be: YOURPROJECT\web\WEB-INF\web.xml
EDIT (August 21, 2015)
Got downvote with duffymo comment that my answer is incorrect.

And I decided to illustrate my answer with step by step pictures in order to avoid misunderstandings.
I am going to illustrate Netbeans behavior on Linux (Ubuntu) and Windows (Windows 7) operating systems.
Linux:
- Let me create a simple Java web project with default settings.

- We are going to the project folder to check the contents of this folder:

note that there is a web folder.
- Further:


You can create the web.xml file in this folder manually or do it using Netbeans through the context menu of the project "New β Create β Other":


Now we go to the YOURPROJECT\web\WEB-INF\ folder to see that web.xml is:

The same rules apply to the Windows operating system; check the following figures:


Here you can create web.xml:

or use Netbeans as I described above.
user784540
source share