For one of my projects, I need to display MS word document on web browser using JSF 2.0. The web application contains header, contents and so on. The MS word document should be displayed dynamically (using AJAX) on content part. The backing bean reads ms word document. I can display MS word document on browser using JSF as an independent application. But if call this from another JSF file this is not going to work. Could anybody throw some light on this issue ?

JSF independent application DiaplayDoc.xhtml. This will display MS document on the browser.

I need to call this page from another jsf file which contains other jsf components. The header portion will be executed, but not the footer part. (This works fine when the footer is set to display pdf plug ins or the images.)

To format code, indent code with 4 spaces. You can do that automatically by selecting the code part in editor and then pressing 010101 button in toolbar or the Ctrl+K key. See also formatting rules in the right hand column while in the message editor. I've already done it for you.
–
BalusCDec 15 '10 at 15:26

1 Answer
1

JSF is insuitable for this purpose. This way you malform the DOC output with a HTML doctype and other HTML tags around the binary DOC content. Replace it by a servlet and let the <object data> point to the servlet URL. If necessary, you can pass bean properties around as servlet request parameters like

Hello BalusC DocTest is my servlet which calls and loads word file. Called from Doc.xhtml file <object data="DocTest"></object> It did not call the servlet. Servlet DocTest has been mapped in web.xml file. Do I miss something ? GDK
–
GDKDec 15 '10 at 17:22

Either the URL is wrong or the servlet failed to startup. Verify if the URL is correct and/or read the logs.
–
BalusCDec 15 '10 at 17:23