首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >com.github.dandelion.datatables.core.export.ExportProperties :java.lang.ClassNotFoundException

com.github.dandelion.datatables.core.export.ExportProperties :java.lang.ClassNotFoundException
EN

Stack Overflow用户
提问于 2014-06-02 09:41:48
回答 2查看 934关注 0票数 0

我正在使用dandalion数据与我的春季项目。我想导出我的数据网格到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过滤器

代码语言:javascript
复制
 <!-- 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中

代码语言:javascript
复制
 <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>

但我会跟着错误走。

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) at com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter.doFilter(DatatablesFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.github.dandelion.core.web.DandelionFilter.doFilter(DandelionFilter.java:157) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at 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( org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.

我遗漏了什么??

请提供任何帮助。提前谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-06-02 11:00:44

从v0.10.0开始,安装步骤发生了变化,而datatables-servlet2已不再存在,在其中保留了您提到的旧的DatatablesFilter类。

首先,确保在web.xml文件中声明了所有需要的组件,特别是DandelionFilterDandelionServlet。安装指南这里。还编写了一个从0.9.x到0.10.x的迁移指南

关于导出特性,您似乎更喜欢基于过滤器的导出。在这种情况下,您还必须更新web.xml文件:

代码语言:javascript
复制
<!-- Dandelion-Datatables filter used for basic export -->
<filter>
    <filter-name>datatables</filter-name>
    <filter-class>com.github.dandelion.datatables.core.web.filter.DatatablesFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>datatables</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping> 

在使用基于过滤器的导出时,请阅读更多关于需求的这里

默认情况下,XML为datatables-core和CSV提供实用程序类。如果要导出PDF、XLS或XLSX格式,则存在其他实用程序,它们位于不同的附加程序中。请参阅有关导出特性这里的新介绍。

当然,为了避免任何其他依赖问题,我强烈建议使用构建工具,如Maven或Gradle。

(StackOverflow要求的免责声明:我是“蒲公英”的作者)

票数 1
EN

Stack Overflow用户

发布于 2014-06-02 09:46:28

看来datatables-core-x.y.z.jar在你的类路径中不见了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23991546

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档