我正在尝试安装蒲公英数据表,我在配置上遇到了一些问题。
按照指南这里,我在pom中添加了以下内容
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-jsp</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-itext</artifactId>
<version>1.1.0</version>
</dependency>然后,我将以下内容添加到我的web.xml文件中
<!-- Dandelion servlet definition and mapping -->
<servlet>
<servlet-name>dandelionServlet</servlet-name>
<servlet-class>com.github.dandelion.core.web.DandelionServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dandelionServlet</servlet-name>
<url-pattern>/dandelion-assets/*</url-pattern>
</servlet-mapping>
<!-- Dandelion filter definition and mapping -->
<filter>
<filter-name>dandelionFilter</filter-name>
<filter-class>com.github.dandelion.core.web.DandelionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>dandelionFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>我向jsp页面提供从spring控制器到jsp页面的数据,其中我放置了以下内容
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<datatables:table id="myTableId" data="${data}">
<datatables:column title="ID" property="id" />
</datatables:table>我使用Servlet3.1(下面的web.xml)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">我的容器是tomcat 8
问题
如果填充了表,但无法访问css和js文件。datatable可以正常工作,但不需要样式设置。然而,分页工作。
下面是一些无法到达的链接。
http://localhost:8080/dtproject/dandelion/datatables/css/jquery.dataTables.css http://localhost:8080/dtproject/dandelion/jquery/js/jquery.js http://localhost:8080/dtproject/dandelion/datatables/js/jquery.dataTables.js
有人能帮忙吗?
谢谢
更新
为了告诉引擎从外部CDN加载资源,我在datatables.properties conf文件中添加了下面一行
asset.locations.resolution.strategy = remote,webapp,webjar,classpath,jar当我运行程序时,我会得到以下错误:
Dandelion: Some properties of your configuration file are not recognized.
The group 'asset' contains 1 unknown property:发布于 2015-09-23 10:08:15
我将servlet版本从3.1降到3.0,现在它可以工作了
生活有时很奇怪
https://stackoverflow.com/questions/32717079
复制相似问题