Answer the question
In order to leave comments, you need to log in
HTML images in HTMLPanel?
There is a problem. for example i have an html file Description.html
and it contains something like
<p>
<img src="Bill.jpg">
</p>
...
<ui:style src="../Style.css"/>
<g:SimplePanel ui:field="panel" addStyleNames="{style.description}" />
...
public SomeWidget() {
initWidget(uiBinder.createAndBindUi(this));
panel.setWidget(new HTMLPanel(HtmlTextResources.htmlFile().getText());
}
> [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
Answer the question
In order to leave comments, you need to log in
As it turned out, it was necessary to create the images package in the webApp and copy the image into it, and register <img src="../images/Bill.jpg">
AND clear the cache, otherwise the image was not immediately displayed.
What do you mean it's not displayed? Does the code show up on the page? If yes, is the path correct? Maybe you're just missing a slash at the beginning?
Bill.jpg lies nearby, in the same folder as the html file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question