我在我的春季项目中使用蒲公英数据表。我想将我的数据表网格导出为 pdf、excel 等。
所以我从PDF开始
按照这个链接
我一个一个地跟着步骤。
第 1 步:添加 jar 文件
datatables-export-itext-0.10.0.jar
datatables-export-poi-0.10.0.jar
datatables-export-poi-ooxml-0.10.0.jar
itext-1.3.jar
第 2 步: Web.xml
添加过滤器
<!-- Dandelion-Datatables filter definition (used for export) -->
<filter>
<filter-name>datatablesFilter</filter-name>
<filter-class>com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>datatablesFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
在jsp中
<datatables:table id="roles" data="${list}" cssClass="table table-striped" pageable="true" displayLength="5" filterable="true" processing="true" autoWidth="true" export="pdf">
<datatables:column title="Id" property="roleId" />
<datatables:column title="Role" property="role" />
<datatables:export type="pdf" cssClass="btn btn-small" />
</datatables:table>
但我收到以下错误。
java.lang.ClassNotFoundException: com.github.dandelion.datatables.core.export.ExportPropertiesat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1206) 在 com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter.doFilter(DatatablesFilter.java:88) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 com.github.dandelion.core.web.DandelionFilter.doFilter(DandelionFilter.java:157) 在 org.apache.catalina.core.ApplicationFilterChain .internalDoFilter(ApplicationFilterChain.java:235) 在 org.apache.catalina.core.ApplicationFilterChain。doFilter(ApplicationFilterChain.java:206) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java: 118) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework 的 org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) .security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) 在 org....org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:342) 在 org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) 在 org....org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:342) 在 org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) 在 org....doFilter(ExceptionTranslationFilter.java:113) 在 org....doFilter(ExceptionTranslationFilter.java:113) 在 org....
我错过了什么??
请提供任何帮助。提前致谢。