dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

Dandelion Assets is null exception #304

Open sanluck opened 8 years ago

sanluck commented 8 years ago

Often I have a message in my logs : log.txt I don't know when this exception occurs but then it happens my table (based on Dandelion Datatables) has empty content. Maybe it's related on my static resources cache settings?

@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        Integer cachePeriod = this.resourceProperties.getCachePeriod();
        if (!registry.hasMappingForPattern("/webjars/**")) {
            registry.addResourceHandler("/webjars/**").addResourceLocations(
                    "classpath:/META-INF/resources/webjars/")
                    .setCachePeriod(cachePeriod);
        }

        if (!registry.hasMappingForPattern("/static/**")) {
            registry.addResourceHandler("/static/**").addResourceLocations(
                    "/static/")
                    .setCachePeriod(cachePeriod);
        }

        if (!registry.hasMappingForPattern("/dandelion/**")) {
            registry.addResourceHandler("/dandelion/**").addResourceLocations(
                    "classpath:/META-INF/resources/dandelion/")
                    .setCachePeriod(cachePeriod);
        }
    }

I'm using Spring Boot 1.3.1, Dandelion Datatables 1.1.1, Thymeleaf 2.1.2. Application deployed on Tomcat 8.0.28.