我正在尝试覆盖 Tomcat(版本 7)的默认欢迎文件列表,正如它的 conf/web.xml 所建议的那样,通过以下列形式声明一个“welcome-file-list”标签
<welcome-file-list>
<welcome-file>estore.html</welcome-file>
<welcome-file>estore.htm</welcome-file>
<welcome-file>estore.jsp</welcome-file>
</welcome-file-list>
在我的应用程序的 web.xml 中,但我收到这样的错误:
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.estore_jsp
有什么想法吗? 谢谢。
最佳答案
我会试试这个:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
将上面的代码片段添加到您的 web.xml 中
然后在 index.html 中,我将使用
<link />
标记以转发到我想要的目标网页,即在您的情况下为 estore.html。
应该这样做。
关于java - 我无法覆盖 Tomcat 的默认欢迎文件列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14776838/