Hello all,
I have a requirement where i need to click a command link and a PDF file to be opened in a new window. The path of the PDF file is to be taken from a database. So in the backing bean, I get the path, set the contentType to 'application/pdf' and of course writing to a new byte steam. When i run it , a new window opens but the file does not get displayed.... when i checked the logs, I think Ajax4JSF is interfering with this process..... check out the below logs..
[WebContainer : 4] DEBUG org.ajax4jsf.framework.ajax.AjaxContext - Process component tree for collect used scripts and styles
2009-08-05 04:54:22,478 [WebContainer : 4] DEBUG org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlResponseWriterImpl - No content type given, using default content type text/html
2009-08-05 04:54:22,478 [WebContainer : 4] DEBUG org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlResponseWriterImpl - No character encoding given, using default character encoding ISO-8859-1
2009-08-05 04:54:22,478 [WebContainer : 4] DEBUG org.ajax4jsf.framework.renderer.AjaxPhaseListener - Process after phase RENDER_RESPONSE(6)
2009-08-05 04:54:22,478 [WebContainer : 4] DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter - create HTML/XML parser for content type: application/pdf
2009-08-05 04:54:22,478 [WebContainer : 4] DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter - Parser not have support for the such content type, send response as-is
Why does it say no content type given when I have explicitly set the content type ?
Has anybody faced this...??