Spring roo 和用户界面
假设我有一个 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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我倾向于将 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!
创建自定义 Roo 控制器。它还会将一个条目放入
menu.jspx
文件中。为此,您可以使用以下 Roo 命令。
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.