【问题标题】:Img embedding problem in Struts2 jsp pageStruts2 jsp页面中的Img嵌入问题
【发布时间】:2025-11-23 13:45:01
【问题描述】:

我的 struts2 应用程序中有一个名为 home.jsp 的页面。我在这个 home.jsp 中嵌入了一个 html (screencompany.html) 页面。我正在尝试在 html 页面中嵌入图像。但是图像没有加载。请帮帮我。我对 struts2 和 jsp 很陌生。

这里是 home.jsp 代码。

<iframe id="displayFrame" src="http://localhost:3000/jebran/pages/documents/screencompany.html" width="100%" height="500" ></iframe>

这是 screencompany.html 中的代码

 <h1>Illustration 1</h1><br/>
<img src="./images/illus1.gif" width="601" height="128" border="0"/>

文本加载正确,但图像加载不正确。只显示指定大小的空白区域,无法加载图片。

【问题讨论】:

    标签: html jsp iframe struts2


    【解决方案1】:

    如果images/illus1.gif 文件与screencompany.html 文件位于同一目录中,则可以省略点以及前导斜杠。

    【讨论】:

    • 非常感谢,这是一个愚蠢的错误,给出了错误的路径。对不起。