我有这个非常简单的web.xml文件:当我不使用全局名称空间时,为什么web.xml不起作用?
<?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>
当我部署应用程序和访问上下文根,我将采取testx.jsp这是罚款。但在我的web.xml文件,我不希望使用一个全局命名空间,所以我改变了web.xml如下:
<?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>
现在,当我重新启动Tomcat,访问该页面,我会发现自己在/索引而不是/testx.jsp。但为什么?
我正在将应用程序部署到Tomcat服务器。我尝试了Glassfish,但没有遇到这个问题。我想这是一个Tomcat问题?
为什么会在默认情况下关闭? – 2014-11-04 06:57:17