I have used the following in xhtml:
<pe:documentViewer id="documentViewer" height="380"
value="#{myBean.fileContent}" />
and in Bean:
byte[] downloadedFile =handleFileDownload(id);
fileContent = new DefaultStreamedContent(new ByteArrayInputStream(
downloadedFile));
Using this code I am able to view the PDF files, but how do I view other documents like, doc,docx,txt,xsl and xslx?