which one will be given priority in Tomcat 6: index.html or index.jsp?

旧城冷巷雨未停 提交于 2019-12-11 15:44:08

问题


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 ?

Is this index.html or index.jsp ?

Is it configurable ?


回答1:


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>

In the event of a partial request, the above configuration will try index.jsp, then index.html, and then index.htm.



来源:https://stackoverflow.com/questions/2049772/which-one-will-be-given-priority-in-tomcat-6-index-html-or-index-jsp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!