仅作个人笔记,没有很多参考价值:

Dandelion : 

  http://dandelion.github.io/components/core/1.1.1/docs/html/#5-3-plugging-in-your-own-asset-locator

  http://dandelion.github.io/components/datatables/1.1.0/docs/html/#11-1-configuration-loading   

在引入这个组件(1.1.0)的时候遇到了一个nullpointerexception,是这个组件本身的bug, 作者在1.1.1对其进行了修复:

<!-- Need to import version 1.1.1 to fix https://github.com/dandelion/dandelion/issues/66 -->  

然后我们在引入dependence需要做些变动:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>com.sim.template.SimTempleteApplication</start-class>
<java.version>1.8</java.version>
<dandelion.core.version>1.1.1</dandelion.core.version>
<dandelion.datatable.version>1.1.0</dandelion.datatable.version>
</properties>

<dependency>
  <groupId>com.github.dandelion</groupId>
  <artifactId>datatables-thymeleaf</artifactId>
  <version>${dandelion.datatable.version}</version>
  <exclusions>
    <exclusion>
      <groupId>com.github.dandelion</groupId>
      <artifactId>dandelion-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.github.dandelion</groupId>
  <artifactId>datatables-spring3</artifactId>
  <version>${dandelion.datatable.version}</version>
  <exclusions>
    <exclusion>
      <groupId>com.github.dandelion</groupId>
      <artifactId>dandelion-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<!-- Need to import version 1.1.1 to fix https://github.com/dandelion/dandelion/issues/66 -->
<dependency>
  <groupId>com.github.dandelion</groupId>
  <artifactId>dandelion-core</artifactId>
  <version>${dandelion.core.version}</version>
</dependency>

 

debug:

http://192.168.0.109:8080/packaging/?ddl-debug&ddl-debug-page=alerts

 

Question:

http://dandelion-forum.48353.x6.nabble.com/template/NamlServlet.jtp?macro=search_page&node=1&query=production&n=1

 

1.0.1版本 dandelion-datatables启用production mode时遇到的问题:

run configurations 的 VM arguments中添加:-Ddandelion.profile.active=prod

 

com.github.dandelion.core.DandelionException: Dandelion: 'com.github.dandelion.datatables.core.extension.theme.Bootstrap3Theme@f5e94b46' is not a valid theme name. Possible values are: 'bootstrap2', 'bootstrap3' and 'jqueryui'.

fix 之前使用的配置:

datatables.properties:

#File containing Dandelion Datatables properties
main.standalone=true
global.css.theme=bootstrap3
global.feature.displayLength=25
global.feature.pagingType=listbox
#global.feature.paginationType=listbox
global.css.class=table table-bordered table-striped dataTable

# documentation on : http://dandelion.github.io/components/datatables/1.1.0/docs/html/#4-3-dom-positioning
# The syntax available is:
# l - Length changing
# f - Filtering input
# t - The table!
# i - Information
# p - Pagination
# r - pRocessing
# < and > - div elements
# <"class" and > - div with a class
#global.feature.dom = 'f0t<"bottom"ilpr><"clear">'
global.feature.dom = '<"row"<"col-sm-6"l><"col-sm-6"0rf>><"row"<"col-sm-12"t>><"row"<"col-sm-5"i><"col-sm-7"p>>'
global.feature.autoWidth = false
global.feature.processing=false

dandelion_prod.properties

#production mode
bundle.includes=dt-functions
asset.minification = true
asset.css.excludes = datatables
tool.gzip=true
tool.asset.pretty.printing=false
tool.debugger = false
tool.alert.reporting = false
cache = true
tool.bundle.reloading = false
tool.asset.pretty.printing = false

 

di-functions.json

{
"bundle" : "dt-functions",
"assets": [
  {
    "name": "dt-functions",
    "version": "0.1",
    "type": "js",
    "locations": {
      "classpath": "public/js/dt-functions.js"
    }
  },
  {
    "name": "datatable",
    "version": "1.10.7",
    "type": "js",
    "locations": {
      "classpath": "public/plugins/datatables/jquery.dataTables.min.js"
    }
  },
  {
    "name": "datatables",
    "version": "1.10.7",
    "type": "css",
    "locations": {
      "classpath": "public/plugins/datatables/jquery.dataTables.min.css"
    }
  },
  {
    "name": "bootstrap3-theme-js",
    "version": "1.10.7",
    "type": "js",
    "locations": {
      "classpath": "public/plugins/datatables/dataTables.bootstrap.min.js"
    }
  },
  {
    "name": "bootstrap3-theme-css",
    "version": "1.10.7",
    "type": "css",
    "locations": {
      "classpath": "public/plugins/datatables/dataTables.bootstrap.css"
    }
  }
]
}

 

解决方案:去掉global.css.theme=bootstrap3