tomcat6.0中,在conf下有web.xml文件,我用eclipse创建了工程后会自动在工程的web-inf下生成web.xml,但是好像只有conf下的web.xml起作用,自己工程下的web.xml完全不起作用,这是怎么回事?
测试过程如下
D:TOMCAT6/conf/web.xml中有一段代码
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
在自己创建工程中自动生成的web.xml下(路径为D:\TOMCAT6\webapps\test\WebRoot\WEB-INF\web.xml)有一段代码
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
我访问http://localhost:8080/test/ 能显示index内容 ,但是我把自动生成的web.xml下的代码改成
<welcome-file-list>
<welcome-file>ok.jsp</welcome-file>
</welcome-file-list>
相应的将test下的index.jsp改成ok.jsp后
访问http://localhost:8080/test/ 显示404错误然后我把test下的ok.jsp改回index.jsp,自动生成的web.xml还是
<welcome-file-list>
<welcome-file>ok.jsp</welcome-file>
</welcome-file-list>访问http://localhost:8080/test/ 能显示index.jsp的内容
说明是conf/web.xml起了作用,而自动生成的web.xml不起作用。
为什么会出现这样的情况呢?
那位高手解答一下,我是新手,刚入门就栽了一大跟头```
好心帮帮忙吧,我没有分,不好意思
测试过程如下
D:TOMCAT6/conf/web.xml中有一段代码
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
在自己创建工程中自动生成的web.xml下(路径为D:\TOMCAT6\webapps\test\WebRoot\WEB-INF\web.xml)有一段代码
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
我访问http://localhost:8080/test/ 能显示index内容 ,但是我把自动生成的web.xml下的代码改成
<welcome-file-list>
<welcome-file>ok.jsp</welcome-file>
</welcome-file-list>
相应的将test下的index.jsp改成ok.jsp后
访问http://localhost:8080/test/ 显示404错误然后我把test下的ok.jsp改回index.jsp,自动生成的web.xml还是
<welcome-file-list>
<welcome-file>ok.jsp</welcome-file>
</welcome-file-list>访问http://localhost:8080/test/ 能显示index.jsp的内容
说明是conf/web.xml起了作用,而自动生成的web.xml不起作用。
为什么会出现这样的情况呢?
那位高手解答一下,我是新手,刚入门就栽了一大跟头```
好心帮帮忙吧,我没有分,不好意思
自动创建的web.xml好像又起作用了。不解啊,这是怎么回事?