2013-10-10 14 views
3

在html圖像和gif中設置的方式相同。所以我用thymeleafgif圖片不能在thymeleaf-html頁面中使用?

同樣的方式在thymeleaf設置爲

<img th:attr="[email protected]{${ball.png}} , title=#{background}, alt=#{background}" style="width: 150px; height: 150px;" /> 

一樣設置爲

<img th:attr="[email protected]{${run.gif}} , title=#{background}, alt=#{background}" style="width: 150px; height: 150px;" /> 

圖像將顯示有,但GIF圖像不顯示有

GIF圖像的圖像

我不知道爲什麼會發生這種情況。

如果你知道答案,請在這裏分享。

回答

3

@{${run.gif}}嘗試使用屬性gif對屬性run進行URL重寫,我懷疑它是否存在。

如果你想引用相對於你的上下文的圖像,你應該做@{/run.gif}

文檔:Thymeleaf URL Syntax