不从实体开始学习 Spring Roo

发布于 2024-11-05 02:48:55 字数 562 浏览 6 评论 0 原文

我刚刚开始学习Spring Roo。阅读完《10 分钟内创建 Web 应用程序》后。我的印象是,Roo 假设我们已经准备好实体概念,并创建控制器组件 - 或者他们所说的脚手架。

我们正处于原型设计阶段,我们将任务分配给两个人来探索 UI 组件和持久层。在我这边,我正在尝试创建一个简单的用户注册表单,该表单接受用户名、密码,将请求发送到服务器,并使服务器将用户重定向到另一个页面。

有没有一种好的方法可以完成此任务,而无需按照 10 分钟课程中所述创建实体: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-first-steps

我已经下载了 Spring 工具套件(STS ),我正在尝试 STS 中的 roo、maven 功能来帮助我入门。

任何技巧、提示或其他教程的有用链接将不胜感激。谢谢。

干杯,

I just started learning Spring Roo. After reading creating web application in 10 minutes. I have the impression that Roo assumes that we have an entity concept ready, and create the controller component - or what they refer to as scaffolds.

We are in a prototyping stage and we are splitting the task to explore the UI component, and the persistent layer between 2 people. At my side, I am trying to create a simple user registration form that takes in user name, password, send the request to the server, and get the server to redirect a user to another page.

Is there a good approach for this task without having to create entities as described in the 10 minutes lesson: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-first-steps

I have downloaded the Spring Tool suite (STS), and I am trying out the roo, maven, features in the STS to get me started.

Any tips, hints, or helpful links to other tutorial will be greatly appreciated. Thank you.

Cheers,

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

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

发布评论

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

评论(3

熟人话多 2024-11-12 02:48:55

是的,这就是所谓的废弃脚手架并手动编码您需要的页面和控制器,以及 servlet(如果您需要的话)(您通常不需要)。
如果您使用 Spring MVC(如果您不使用 GWT,则为默认 ui),那么就像将您自己的控制器添加到处理 POST 和 GET 请求的列表中一样简单,通过 Model 对象将参数传递回前端,更新视图以显示您的页面,然后如果您仍然想使用 roo 生成的脚手架来执行某些操作,您可以移动它显示的页面。

http://static.springsource.org/spring/docs/3.0 .x/reference/mvc.html

Yes, it is called scrapping the scaffold and hand coding the pages and controllers you need, servlets if you need them (which you usually don't).
If you're using Spring MVC (the default ui if you're not using GWT), then it is as simple as adding your own controller to the list which handles POST and GET requests, pass paramaters back to the frontend via the Model object, updating the Views to display your pages and then if you still want to use the roo generated scaffold for certain things, you can move the pages it is displayed on.

http://static.springsource.org/spring/docs/3.0.x/reference/mvc.html

阳光①夏 2024-11-12 02:48:55

您将需要创建实体/类。您必须有一些基本的类图,您可以使用它们来从 ROO 开始构建运行的基本 Java 应用程序。

如果您关心的是如何让多个人一起工作,那么 - 参考这个 SO 线程

希望有帮助。

You will need to create entities/classes. You will have to have some basic class diagram that you can use to start off with ROO to build the basic Java app running.

If your concern is how more than one person is going to work on it then - refer this SO thread.

Hope that helps.

心是晴朗的。 2024-11-12 02:48:55

我最近也开始学习ROO。据我了解,实体是原产地组织的核心。

  • 对于您添加的每个实体,您可以使用 ROO 为该实体添加控制器。
  • 对于您添加的每个控制器,ROO 将自动生成创建、列表、显示和更新视图(使用 jspx、Dojo JavaScript lib 和 spring-js)。 Roo 还安装了一个 tagx 库,所有生成的视图都会使用该库。
  • 在视图中,ROO 为您在相应实体中定义的每个字段添加一个表单字段。

那么回到你的问题。从您最终将拥有的实体模型开始。然后使用ROO创建将用于存储用户注册信息的实体,并为该实体添加控制器。此时,您可以开始探索 UI 组件,其他人可以开始添加您需要的实体(不添加控制器,因此不会生成视图)并探索持久层。

I also started learning ROO recently. And based on what I understand entities are central to ROO.

  • For each entity that you add, you can use ROO to add a controller for that entity.
  • For each controller you add ROO will automatically generates the Create, List, Show and Update views (using jspx, Dojo JavaScript lib and spring-js). Roo also installs a tagx library which is used by all the generated views.
  • In the views ROO adds a form field for each field you defined in the corresponding entity.

So coming back to your question. Start with a entity model that you will eventually have. Then use ROO to create the entity that will be used for storing the user registration information and also add controller for this entity. At this point you can start exploring the UI component and other person can start adding entities (without adding Controllers, so no view will be generated) that you will need and explore the persistence layer.

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