2015-09-22 60 views
1

我試圖安裝蒲公英數據表和我有一些問題與配置如何安裝蒲公英數據表

繼引導here添加以下到我的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> 

我從Spring MVC的控制器的數據服務,以我的jsp頁面,我把下面

<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %> 

<datatables:table id="myTableId" data="${data}"> 
    <datatables:column title="ID" property="id" /> 
</datatables:table> 

我使用的servlet 3.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文件無法訪問。數據表反而工作正常,但沒有造型。分頁然而工作。

生成的部分鏈接無法訪問。

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

誰能幫助?

感謝

UPDATE

要告訴引擎加載外部的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: 

回答

1

我降級Servlet版本從3.1到3.0,現在它的工作原理

生活是陌生的某個時候

相關問題