Java HTMLPanel中的HTML图像

Java HTMLPanel中的HTML图像,java,html,gwt,gxt,uibinder,Java,Html,Gwt,Gxt,Uibinder,这是我的问题。例如,我有一些HTML文件Description.HTML,它包含如下内容 <p> <img src="Bill.jpg"> </p> 此小部件的构造函数是: public SomeWidget() { initWidget(uiBinder.createAndBindUi(this)); panel.setWidget(new HTMLPanel(HtmlTextResources.htmlFile()

这是我的问题。例如,我有一些HTML文件
Description.HTML
,它包含如下内容

<p>
    <img src="Bill.jpg">
</p>
此小部件的构造函数是:

public SomeWidget() {
        initWidget(uiBinder.createAndBindUi(this));
        panel.setWidget(new HTMLPanel(HtmlTextResources.htmlFile().getText());
    }
问题所在-bill.img不显示。 控制台显示

> [WARN] 404 - GET /bill.jpg (127.0.0.1) 1373 bytes    Request headers
>       Host: 127.0.0.1:8888
>       Connection: keep-alive
>       Cache-Control: no-cache
>       Accept: image/webp,*/*;q=0.8
>       Pragma: no-cache
>       User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153
> Safari/537.36
>       *****************
>       Accept-Encoding: gzip,deflate,sdch
>       Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,it;q=0.2,uk;q=0.2    Response
> headers
>       Content-Type: text/html;charset=ISO-8859-1
>       Cache-Control: must-revalidate,no-cache,no-store
>       Content-Length: 1373

我怎样才能解决这个问题?有必要通过html使用PIC,GWT应用程序中的任何相对URL通常都是相对于WEB-INF目录读取的(或者调用WEB.xml所在的目录)。与HTML页面所在的目录无关


因此,如果您不想替换Description.html中的所有URL,您应该将引用的文件移动到WEB-INF。

无需进一步了解,我猜“bill.jpg”不在根文件夹中,它由您的服务器提供服务。也许它位于一个子目录中。也许是有价值的。
> [WARN] 404 - GET /bill.jpg (127.0.0.1) 1373 bytes    Request headers
>       Host: 127.0.0.1:8888
>       Connection: keep-alive
>       Cache-Control: no-cache
>       Accept: image/webp,*/*;q=0.8
>       Pragma: no-cache
>       User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153
> Safari/537.36
>       *****************
>       Accept-Encoding: gzip,deflate,sdch
>       Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,it;q=0.2,uk;q=0.2    Response
> headers
>       Content-Type: text/html;charset=ISO-8859-1
>       Cache-Control: must-revalidate,no-cache,no-store
>       Content-Length: 1373