问题描述
限时送ChatGPT账号..我们的 Web 应用程序包含 index.html 和 index.jsp,我们使用 Apache Tomcat 6.当请求具有直到上下文的路径(例如,http://localhost:8080/mysite) 来到tomcat会服务哪一个?
Our web app contains both index.html and index.jsp, and we use Apache Tomcat 6. When a request having the path till the context (for eg.,http://localhost:8080/mysite) comes to the tomcat which one will be served ?
这是 index.html 还是 index.jsp ?
Is this index.html or index.jsp ?
是否可以配置?
推荐答案
index.html
将优先,但您可以在 welcome-file-list
下更改此设置在 web.xml
中.
index.html
will be given preference, but you can change this under welcome-file-list
in web.xml
.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
在部分请求的情况下,上面的配置会先尝试index.jsp
,然后是index.html
,然后是index.htm
.
In the event of a partial request, the above configuration will try index.jsp
, then index.html
, and then index.htm
.
这篇关于Tomcat 6 中会优先考虑哪一个:index.html 或 index.jsp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论