将 SproutCore 前端集成到 Grails 应用程序中

发布于 2024-10-21 05:37:49 字数 490 浏览 0 评论 0原文

我正在评估 SproutCore 是否可以用作现有 Grails 应用程序的前端。人们通常如何为这种类型的设置构建他们的 SproutCore 和 Grails 项目?

SproutCore 文档介绍了如何连接到 ToDos 教程,但我还没有看到如何将两者集成来构建单个 war 文件的教程。

我们希望将所有内容都通过“grails war”任务捆绑在一起,以便我们可以继续简单地部署单个 war 文件来部署整个应用程序(包括 SproutCore 前端)。因此,在 Grails 项目的“战争”步骤中对 SC 项目调用 sc-build 命令似乎是合理的第一步。但是 grails Web 应用程序中的哪里可以放置生成的 SC 内容等?我很想听听人们是如何做到这一点的,以免重新发明轮子。

I'm evaluating SproutCore for possible use as a front end with an existing Grails application. How do people typically structure their SproutCore and Grails projects for this type of setup?

The SproutCore docs cover how to connect to a Grails back-end in the ToDos tutorial, but I haven't yet seen a tutorial for how to integrate the two to build a single war file.

We would prefer to have everything bundled up by the 'grails war' task so that we can continue to simply deploy a single war file to deploy the entire application (including the SproutCore front end). So calling the sc-build command on the SC project during the 'war' step in the Grails project seems like a reasonable first step. But where in the grails web-app to place the generated SC stuff, etc.? Would love to hear how people are doing this so as to not reinvent the wheel.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

叫思念不要吵 2024-10-28 05:37:49

我倾向于将 RIA 视为独立于它们使用的任何后端的项目。尤其是 SC,这是事实,因为 SC 是在浏览器中使用的完整应用程序堆栈。所以我的建议是将 SC 客户端视为一个单独的项目。

正如您在问题中所指出的,问题变成了如何在您的战争中部署 SC 项目。幸运的是,答案还不错。查看

http://grails.org/doc/latest/ 的最后一部分guide/17.%20Deployment.html

您将看到您可以轻松地连接到 grails 构建过程。在那里你需要做的就是调用 sc-build 命令并将文件复制到 js 文件在 war 中所在的位置。只需确保引导客户端的 gsp 中的路径正确即可。 SC 生成一个默认的 index.html,当您挂接到 grails 部署过程中时,您可能可以使用它(将其复制到适当的位置)。

I tend to think of RIAs as a separate project from any back-end they use. With SC in particular this is true, as SC is a full application stack for use in the browser. So my advice is the treat the SC client as a separate project.

As you have indicated in your question, the problem becomes how to deploy the SC project with your war. Fortunately the answer is not too bad. Check out the last section of

http://grails.org/doc/latest/guide/17.%20Deployment.html

You will see that you can hook into the grails build process easily. In there all you need to do is invoke the sc-build command and copy the files into where js files go in a war. Just make sure the paths in the gsps that bootstrap the client are correct. SC generates a default index.html, you can probably just use that (copy it to the appropriate place) when you hook into the grails deployment process.

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