In this page i have a button that call the method "verExpediente.documentoOriginal" that generates the html response. This button call itself automatically when the page is loaded
<h:commandButton id ="botonMostrarPDF" action="#{visualizador.verDocumento(verExpediente.documentoOriginal)}" value="Visualizando Factura">