In a java web application, there is a file called web.xml and it has a versioning.

What exactly is this? What is it used for?

Here is the SO wiki for web.xml. But it does not really explain me much.

It allows you to define, declare and configure the Servlet API based implementations in your web application, such as servlets, filters and listeners.

Sample web.xml versioning:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">

Can someone explain this with simple examples perhaps?

Edit
Report