4

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,

zfranciscus
  • 16,175
  • 10
  • 47
  • 53

3 Answers3

2

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

Jan Vladimir Mostert
  • 12,380
  • 15
  • 80
  • 137
1

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.

Community
  • 1
  • 1
Nilesh
  • 4,137
  • 6
  • 39
  • 53
1

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.

himanshu
  • 2,087
  • 1
  • 13
  • 13