Java webapp中的Groovy Web控制台? [英] A Groovy Web Console in a Java webapp?

查看:384
本文介绍了Java webapp中的Groovy Web控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在查看Groovy,我喜欢 Groovy Web控制台



我真的想知道是否有一种方法来嵌入一个简单的网页控件来编写和运行脚本,我可以把自己放在一起。是否有插件式解决方案来嵌入这样的控件?

  • 有任何资源或

  • 解决方案

    Grails Web框架具有Grails控制台,它基本上是一个Groovy控制台,可以访问您的Web应用程序的状态。更具体地说,在Grails控制台中有一堆预定义的变量,您可以在运行时使用它们访问/更改Web应用程序。例如 ctx 是一个预定义的变量,提供对应用程序的Spring bean(AKA ApplicationContext)的访问。



    grails控制台作为桌面应用运行,但有一个插件可供您将其包含为部分应用程序本身,因此通过Web浏览器使用它。


    I've been looking at Groovy a little lately, and I love the idea of the Groovy Web Console.

    I'm idly wondering whether there's a way to embed a simple web control to write and run scripts from in a web app I might put together myself.

    • Is there a plugin-style solution to embed a control like this?
    • Are there any resources or guidance out there to help in persisting source code?

    解决方案

    The Grails web framework has the Grails console which is basically a Groovy console that has access to your web app's state. More specifically, in the Grails console there are a bunch of predefined variables which you can use to access/change the web app at runtime. For example ctx is a predefined variable that provides access to the application's Spring beans (AKA ApplicationContext).

    Normally the grails console runs as a desktop app, but there's a plugin available that will let you include it as part of the application itself, and therefore use it via a web browser.

    这篇关于Java webapp中的Groovy Web控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆