【问题标题】:How to avoid CHKJ3010W: Welcome Files cannot begin or end with a /如何避免 CHKJ3010W:欢迎文件不能以 / 开头或结尾
【发布时间】:2012-11-25 09:15:05
【问题描述】:

我的欢迎文件列表如下所示:

<welcome-file-list>
    <welcome-file>/WEB-INF/jsp/index.jsp</welcome-file>
</welcome-file-list>

这会在 Eclipse 中引发以下警告:

CHKJ3010W: Welcome Files cannot begin or end with a /.  in web.xml  

如果我们删除 WEB-INF 前面的 /,页面将无法在 JBoss 中正确提供。如果我们添加 / 我们会收到上述警告。

如何避免这个警告?

【问题讨论】:

    标签: java jsp jakarta-ee web-applications servlets


    【解决方案1】:

    您应该指定可公开访问的文件。看http://wiki.metawerx.net/wiki/Web.xml.WelcomeFileList

    创建公共index.jsp,其中将包含来自您的/WEB-INF/jsp/index.jsp 的数据

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-30
      • 1970-01-01
      • 1970-01-01
      • 2012-04-08
      • 1970-01-01
      • 2019-01-26
      • 1970-01-01
      • 2022-12-02
      相关资源
      最近更新 更多