Spring roo 和用户界面

发布于 2024-10-15 20:52:44 字数 266 浏览 2 评论 0原文

假设我有一个 Item 实体和一个 Basket 实体。购物篮可以包含任意数量的物品。篮子的典型 Spring Roo 界面可能如下所示: 在此处输入图像描述

假设我想向购物篮列表添加另一个按钮,也许是结账按钮。最好的方法是什么?另外假设我还没有完成我的实体,Roo 可能会重新生成很多东西。

我考虑过修改标签,但我对 MVC、spring 和 jsp 还很陌生,所以目前正在努力解决。

Imagine I have an Item entity and a Basket entity. The Basket may contain any number of items. The typical Spring Roo interface for the basket might look something like this:
enter image description here

Lets say I want to add another button to the basket list, perhaps a checkout button. What would be the best way of going about that? Also assuming I haven't yet finished with my entities and Roo might re-generate alot of stuff.

I thought about modifying the tags, but I'm quite new to MVC, spring and jsp so battling through at the moment.

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

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

发布评论

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

评论(2

傲娇萝莉攻 2024-10-22 20:52:44

我倾向于将 Roo Scaffold 应用程序视为这样:一个我可以围绕它构建自己的用户界面的脚手架。我更熟悉 GWT 生成的接口,但我认为 Spring MVC 世界大致相同。

Roo 在创建维护应用程序数据模型所需的所有垃圾方面做得很好,但良好的用户界面仍然需要一些自定义代码。在 GWT 世界中,Roo 很好地阐释了实现 UI 的最佳实践。我建议研究脚手架应用程序的工作原理,然后复制您需要的部分,同时添加所有自定义位。

乍一看可能令人畏惧,但如果很容易,每个人都会这样做!

I tend to treat the Roo Scaffold application as just that: a scaffold that I can build my own user interface around. I'm more familiar with the GWT-generated interfaces, but I assume the Spring MVC world is about the same.

Roo does a great job of creating all the junk necessary for maintaining the data model of an application, but a good user interface is still going to take some custom code. In the GWT world, Roo does a good job of illustrating the best practices for implementing a UI. I would suggest studying how the Scaffold application works, and then duplicating the pieces you need while adding all the custom bits as well.

Might seem daunting at first, but if it were easy everyone would do it!

久光 2024-10-22 20:52:44

创建自定义 Roo 控制器。它还会将一个条目放入 menu.jspx 文件中。

为此,您可以使用以下 Roo 命令。

controller class --class ~.web.MyCustomController

Create a custom Roo controller. It would also put an entry to the menu.jspx file as well.

You can use the following Roo command for this.

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