As in Configuring Icefaces and Seam PDF, when you want to render excel pages in an application that already uses seam and icefaces, you need to use the default view handler for rendering the excel files. So you need to follow some of the same steps… Separate out the pages so that some are icefaces pages only, the other pages are non-icefaces and do the Excel rendering. Replace icefaces.jar with just-ice.jar and configure the application to delegate pages that contain to the standard facelets view handler.
Steps:
1. Update to icefaces 1.8.1 and jboss-seam 2.2.0.GA and test the application still functions correctly.
2. Replace icefaces.jar with just-ice.jar (from the icefaces jars) and redeploy the application. Fix any errors.
3. Add in the excel functionality. Add jboss-seam-excel-2.2.0.GA.jar and jxl.jar to your ear file.
4. In components.xml add the excel and document namespaces
xmlns:excel="http://jboss.com/products/seam/excel"
xmlns:document="http://jboss.com/products/seam/document"
http://jboss.com/products/seam/document http://jboss.com/products/seam/document-2.2.xsd
http://jboss.com/products/seam/excel http://jboss.com/products/seam/excel-2.2.xsd
5. In faces-config.xml you add both view handlers
com.sun.facelets.FaceletViewHandler
com.icesoft.faces.facelets.D2DSeamFaceletViewHandler
JSFoverride
6. Configure the document servlet in web.xml
Document Store Servlet
org.jboss.seam.document.DocumentStoreServlet
Document Store Servlet
*.csv
Document Store Servlet
*.xls
and add a new mapping for jsf pages to be handled by the Faces Servlet
Faces Servlet
*.jsf
Your application should now be configured to render excels. To test this you can copy some of the .xhtml pages from the seam examplesexcel to test that the rendering works. Take ExcelTest.java and people.xhtml. Create a normal index page and add a link to people.jsf.
2nd Excel Test/>
In people.xhtml I had to edit the value to excelTest.people instead of people
Now redeploy your application and try accessing people.jsf
Your right, I found this entry in the IceFaces release note:When rnninug a JSF application in JSF2 PROJECT_STAGE= Development mode (which is the default setting for all ICEfaces sample applications), you may see the follow warning appear at the bottom of the page: Form component needs to have a UIForm in its ancestry. . This issue is caused by a bug in Mojarra JSF, a suggested work-around is to set the JSF2 PROJECT_STAGE= Production in the web.xml file.