我刚刚开始学习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,
发布评论
评论(3)
是的,这就是所谓的废弃脚手架并手动编码您需要的页面和控制器,以及 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
您将需要创建实体/类。您必须有一些基本的类图,您可以使用它们来从 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.
我最近也开始学习ROO。据我了解,实体是原产地组织的核心。
那么回到你的问题。从您最终将拥有的实体模型开始。然后使用ROO创建将用于存储用户注册信息的实体,并为该实体添加控制器。此时,您可以开始探索 UI 组件,其他人可以开始添加您需要的实体(不添加控制器,因此不会生成视图)并探索持久层。
I also started learning ROO recently. And based on what I understand entities are central to ROO.
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.