【问题标题】:404 NoTargetForURIException accessing static resources in WebContent folder under Websphere 7404 NoTargetForURIException 访问 Websphere 7 下 WebContent 文件夹中的静态资源
【发布时间】:2013-11-09 19:56:09
【问题描述】:

在一个面向 WebSphere Application Server 7 的 Eclipse Web 项目中,我在 WebContent 下的 css 子文件夹中有 CSS 文件。当我尝试从浏览器访问它们时,我收到 404 错误提示:

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /css

【问题讨论】:

    标签: java servlets websphere-7


    【解决方案1】:

    解决方案是在 ibm-web-ext.xml 中启用文件服务。

    1. 双击 web.xml 打开 Web 应用程序部署 描述编辑器。
    2. 选择“打开 WebSphere 扩展 描述符”链接。
    3. 选中“启用文件服务”复选框并保存 您的更改。

    这会将以下行添加到 ibm-web-ext.xml:

    <enable-file-serving value="true"/>
    

    感谢 CodeRanch 的解决方案。

    【讨论】:

      【解决方案2】:

      出现此错误的另一种方法是主机后的路径名错误。例如,如果您正在部署 EAR,并尝试点击 EAR 的名称。您必须确保路径与 Web 应用程序名称完全匹配。

      【讨论】:

      • 不,在这种情况下你会得到SRVE0255E: A WebGroup/Virtual Host to handle /HelloWorldFFF/index.jsp has not been defined.
      【解决方案3】:

      确保上下文根是正确的。

      可以在 WebSphere Application Server 管理控制台中执行此操作。查看 IBM 的 Resolving the problem

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-08
        • 2021-06-21
        • 1970-01-01
        • 1970-01-01
        • 2015-07-01
        • 1970-01-01
        • 2011-01-21
        • 1970-01-01
        相关资源
        最近更新 更多