java - 我无法覆盖 Tomcat 的默认欢迎文件列表

标签 java jsp tomcat tomcat7

我正在尝试覆盖 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>
  1. 将上面的代码片段添加到您的 web.xml 中

  2. 然后在 index.html 中,我将使用 <link />标记以转发到我想要的目标网页,即在您的情况下为 estore.html。

应该这样做。

关于java - 我无法覆盖 Tomcat 的默认欢迎文件列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14776838/

相关文章:

java - 如何在 JBehave 的测试执行中包含和排除场景?

java - 单元测试最终在 Java 6 中阻塞

java - 为什么我得到一个 EJB java.rmi.MarshalException : CORBA MARSHAL exception?

java - 如何将Tomcat 8 配置为中介代理?

java - 如何使用绑定(bind)类通过代码将 JComboBox selectedItem 绑定(bind)到 Jtable?

jsp - 如何在 JSP 文件中显示变量值

javascript - 在jsp页面中循环对象列表

java - 为防止内存泄漏,已强制注销 JDBC 驱动程序

eclipse - 从 Eclipse 运行 Tomcat - 错误

Java 计算平均执行时间