Tomcat 6中将优先考虑哪一个:index.html或index.jsp?

时间:2010-01-12 14:51:42

标签: web-applications tomcat6

我们的Web应用程序包含index.html和index.jsp,并且我们使用Apache Tomcat 6.当具有直到上下文的路径的请求(例如,http://localhost:8080/mysite)进入tomcat时哪个会送达?

这是index.html还是index.jsp?

可以配置吗?

1 个答案:

答案 0 :(得分:3)

index.html会优先考虑,但您可以在welcome-file-list的{​​{1}}下进行更改。

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

相关问题