Tomcat 6 中会优先考虑哪一个:index.html 或 index.jsp? [英] which one will be given priority in Tomcat 6: index.html or index.jsp?

查看:51
本文介绍了Tomcat 6 中会优先考虑哪一个:index.html 或 index.jsp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆