1 Reply Latest reply on May 5, 2011 7:42 PM by Nick Belaevski

    keepalive doesn´t work for mediaOutput?

    Antonio Roldán Newbie

      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() );

              }

          }