Wicket动态资源显示在HTML中 [英] Wicket Dynamic Resource Displayed in HTML
问题描述
我有一个Wicket页面,它将动态显示图像。假设图像是当前的日期/时间。
I have a Wicket page which will dynamically display an image. Let's say the image is the current date/time.
在HTML中,我会有一些像
In HTML, I would have something like
<img src="[dynamically generated]"/>
假设我有一个实用程序方法,返回给我当前图像的byte []。 p>
Assume I have a utility method which returns to me a byte[] of the current image.
public byte[] getCurrImage();
如何在Wicket(HTML / Java)中实现此动态资源?我无法挂载共享资源,因为图像将始终保持不变。我需要保存图像吗?
How do I implement this dynamic resource in Wicket (HTML/Java)? I can't mount a shared resource because the image will keep changing all the time. Do I need to save the image somewhere?
谢谢
推荐答案
查看 JFreeChart和检票口示例。
您将看到一个派生自 Image
的类的示例,它将获取 byte []
动态创建像您所问的图像。
Checkout JFreeChart and wicket example.
There you will see an example of a class that derives from Image
and it gets a byte[]
to dynamically create an image like you asked.
这篇关于Wicket动态资源显示在HTML中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!