Grails 2.0:“未配置 javascript 提供程序”

发布于 2024-12-15 05:20:11 字数 1620 浏览 1 评论 0原文

您好,我的一些视图收到以下错误:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

失而复得 2024-12-22 05:20:11

如果您从 grails 中删除 jquery 插件,也会发生这种情况。现在,它默认使用 grails 2.x 进行配置。

您可以在 BuildConfig.groovy 的插件部分中声明它,如下所示:

plugins {
    // other plugins here...

    runtime ":jquery:1.8.3"
}

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:

plugins {
    // other plugins here...

    runtime ":jquery:1.8.3"
}
究竟谁懂我的在乎 2024-12-22 05:20:11

好的,我已经安装了 jQuery 并且现在可以使用了。我以为我可以让它与 library="application" 一起使用,但没关系

Ok, I have installed jQuery and it works now. Thought I get it to work with library="application" but never mind

套路撩心 2024-12-22 05:20:11

对于这个特定问题,如果您使用的是 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. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文