Grails 2.0:“未配置 javascript 提供程序”
您好,我的一些视图收到以下错误:
2011-11-11 17:22:07,497 ERROR errors.GrailsExceptionResolver - GrailsTagException occurred when processing request: [GET] /<appname>/test/list
No javascript provider is configured. Stacktrace follows:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: No javascript provider is configured
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: No javascript provider is configured
at C__Development_bla_app_trunk_grails_app_views_test_list_gsp$_run_closure2.doCall(C__Development_bla_app_trunk_grails_app_views_test_list_gsp:72)
at C__Development_bla_app_trunk_grails_app_views_test_list_gsp.run(C__Development_bla_app_trunk_grails_app_views_test_list_gsp:83)
... 3 more
我已尝试以下操作:
在 Config.groovy 中:
grails.views.javascript.library="jquery"
或
grails.resources.modules = {
core {
dependsOn 'jquery'
}
}
在布局中:
<g:javascript library="jquery" />
<r:layoutResources/>
在 GSP 中(上面带有 grails.resources.modules
):
<r:require module="core"/>
什么都没有。 ..总是同样的错误。我已经没有想法了,希望其他人也有一个。 我怎么知道我已经安装了 jquery,还有其他 javascript 库吗?
这是 Grails 2.0.0.RC1
非常感谢
Jonas
Hello I received the following error for some of my views:
2011-11-11 17:22:07,497 ERROR errors.GrailsExceptionResolver - GrailsTagException occurred when processing request: [GET] /<appname>/test/list
No javascript provider is configured. Stacktrace follows:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: No javascript provider is configured
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: No javascript provider is configured
at C__Development_bla_app_trunk_grails_app_views_test_list_gsp$_run_closure2.doCall(C__Development_bla_app_trunk_grails_app_views_test_list_gsp:72)
at C__Development_bla_app_trunk_grails_app_views_test_list_gsp.run(C__Development_bla_app_trunk_grails_app_views_test_list_gsp:83)
... 3 more
I have tried the following:
in Config.groovy:
grails.views.javascript.library="jquery"
or
grails.resources.modules = {
core {
dependsOn 'jquery'
}
}
in the layouts:
<g:javascript library="jquery" />
<r:layoutResources/>
in the GSP (with grails.resources.modules
above):
<r:require module="core"/>
Nothing... always the same error. I am running out of idea and am hoping anyone else has one.
How do I know I have jquery installed, are there other javascript libraries?
This is Grails 2.0.0.RC1
Thanks a lot
Jonas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您从 grails 中删除 jquery 插件,也会发生这种情况。现在,它默认使用 grails 2.x 进行配置。
您可以在
BuildConfig.groovy
的插件部分中声明它,如下所示:This will also happen if you remove the jquery plugin from grails. It now comes configured by default with grails 2.x
You can declare this in the plugins section of
BuildConfig.groovy
like this:好的,我已经安装了 jQuery 并且现在可以使用了。我以为我可以让它与
library="application"
一起使用,但没关系Ok, I have installed jQuery and it works now. Thought I get it to work with
library="application"
but never mind对于这个特定问题,如果您使用的是 2.0 版本,则必须运行“grails install-plugin prototype”,因为 grails 2.0 不再具有原型。
这对我来说是解决方案。 :)
For this specific problem if you are using version 2.0, you must run "grails install-plugin prototype" because grails 2.0 doesn't have prototype anymore.
This has been the solution for me. :)