简体   繁体   English

JSF Trinidad Image标签替换损坏的图像

[英]JSF Trinidad Image tag replace broken images

I'm using JSF with Trinidad tag 我正在使用带有特立尼达标签的JSF

I was wondering how can I catch error event like in html img tag 我想知道如何捕获类似html img标签中的错误事件

<img src="someimage.png" onerror="imgError(this);"/>

This is my code: 这是我的代码:

<tr:image source="/../myImage.png">

So , I will be able to replace the image with error image. 因此,我将能够用错误图像替换该图像。

Thanks, 谢谢,

Jhon.

我认为最好的解决方案是将source属性指向servlet或bean上的方法,并在其中进行一些逻辑处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM