缺少grails bootstrap文件上传插件的资源?

时间:2014-06-26 21:32:40

标签: jquery twitter-bootstrap grails jquery-file-upload

我正在尝试在grails应用程序中使用grails bootstrap文件上传插件(http://grails.org/plugin/bootstrap-file-upload)。

我的grails版本是2.2.1。插件版本是2.1.2。插件安装成功。我还安装了twitter-bootstrap -3.1.1.3插件。我正在尝试使用上传插件的UI风格。需要包含哪些资源。该插件的文档没有谈论它。

目前我包括以下内容。

<r:require module="bootstrap"/>
<r:require module="bootstrap-file-upload"/>

但是我收到以下错误。

java.lang.RuntimeException: It looks like you are missing some calls to the r:layoutResources tag. After rendering your page the following have not been rendered: [defer]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
    at org.grails.plugin.resource.DevModeSanityFilter.doFilter(DevModeSanityFilter.groovy:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:

BuildConfig.groovy

grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.7
grails.project.source.level = 1.7
grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

    repositories {
        inherits false // Whether to inherit repository definitions from plugins
        grailsPlugins()
        grailsHome()
        mavenRepo 'http://nexusserver/nexus/content/groups/public/'
    }

    dependencies {
        //mysql
        provided 'mysql:mysql-connector-java:5.1.16'
        //joda
        compile "joda-time:joda-time:2.1"
    }

    plugins {
        compile ":hibernate:$grailsVersion"
        compile ":resources:1.1.6"
        compile ":zipped-resources:1.0"
        compile ':cache-headers:1.1.6'
        //compile ":cached-resources:1.0"
        //compile ":yui-minify-resources:0.1.5"
        compile ':cache:1.1.6'
        compile ':spring-security-core:1.2.7.3'
        compile ':spring-security-ldap:1.0.6'
        compile ":jquery:1.10.2"
        compile ":jquery-ui:1.10.3"
        compile ":bootstrap-file-upload:2.1.2"
        compile ":excel-import:1.0.0"
        compile ":twitter-bootstrap:3.1.1.3"

        //target
        build ":tomcat:$grailsVersion"
    }
}

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

请仔细检查您的布局文件(默认为main.gsp),以便有两个<r:layoutResources/>标记,一个位于<head>部分,另一个位于<body>部分。