我使用了 Primefaces 在其网页中的相同示例代码:
<h:commandLink value="Excel">
<p:dataExporter type="xls" target="dataTable" fileName="boo" pageOnly="true"/>
</h:commandLink>
但是不起作用。 在 Internet Explorer 浏览器中显示以下消息:
Details of the errors of the web page Message: Unexpected call to method or property access.
Mozilla Firefox 中什么也没发生。
可能会发生什么?
最佳答案
javax.servlet.ServletException: org/apache/poi/ss/usermodel/RichTextString
在堆栈跟踪中进一步查看。我敢打赌,根本原因是 NoClassDefFoundError
或 ClassNotFoundException
?在这种情况下,这仅意味着您忘记安装 Apache POI 。
下载this Apache POI zip file ,解压它,将 poi-3.8-20120326.jar 放入 /WEB-INF/lib
文件夹中并重建/重新部署/重新启动 web 应用程序。
关于jsf - java.lang.NoClassDefFoundError : org/apache/poi/ss/usermodel/RichTextString at org. primefaces.component.export.ExporterFactory.getExporterForType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13293433/