I have this very simple web.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<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">
<welcome-file-list>
<welcome-file>testx.jsp</welcome-file>
</welcome-file-list>
</web-app>
When I deploy the application and visit the context root, I will be taken to testx.jsp which is fine. But in my web.xml file I do not want to use a global namespace so I change the web.xml as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<ee:web-app xmlns:ee="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">
<ee:welcome-file-list>
<ee:welcome-file>testx.jsp</ee:welcome-file>
</ee:welcome-file-list>
</ee:web-app>
Now when I again start tomcat and visit the page, I will find myself in /index instead of /testx.jsp. But why?
I am deploying the application to Tomcat Server. I tried Glassfish and I did not encounter this problem. I guess this is a Tomcat problem?