Hi,
I have one image inside one blob field at database.
I want to show it using mediaOutput.
If the bean is on session, it works correctly.
But I don´t want to put in on session.
If the bean is on the request, I think keepalive is not working correctly for mediaOutput.
Any idea what´s the problem?
Thanks very much.
<a4j:keepAlive beanName="detalleEstadoBean" />
<a4j:mediaOutput element="img" mimeType="#{detalleEstadoBean.entidad.txMime}"
createContent="#{detalleEstadoBean.paint}" value="#{detalleEstadoBean.entidad}"
style="width:100px;" cacheable="false" session="false">
<f:param value="#{detalleEstadoBean.timeStamp}" name="time"/>
</a4j:mediaOutput>
...
private void init() {
this.id = (Long)this.obtenerParametro("idEntidad");
try {
this.entidad = this.dao.buscarPorId(this.id);
} catch (BaseDeDatosException e) {
e.printStackTrace();
}
}
public void paint(OutputStream stream, Object object) throws IOException {
if(this.entidad.getLbFichero()!=null){
stream.write(((EstadoFenologico)object).getLbFichero() );
}
}
Hi Antonio,
keepAlive uses view state to save the bean, however view state is not available for the request rendering a4j:mediaOutput content. Please check this link for possible solution: http://community.jboss.org/wiki/A4jmediaOutputAndLargeObjectsAsValue .