private byte[] blob = some data...;
pro kontrolu blob je obrázek:
Boolean isImage = ImageIO.read(new ByteArrayInputStream(blob)) != null;
if( isImage ){
// blob is an image...
}
vytvořte objekt IResource a zobrazte jej v html:
IResource imageResource = new DynamicImageResource() {
@Override
protected byte[] getImageData(IResource.Attributes attributes) {
return blob;
}
};
Image image = new Image("wicketId", imageResource);
this.add(image);
v souboru html použijte:
<wicket:panel>
<img wicket:id="wicketId"/>
</wicket:panel>