views:

48

answers:

1

Hey, im just learning Roo.

I have a domain object:

Person {
  private String name;
  private boolean graduated;
}

Id like to create a new page that lists only graduated Person objects. Id like this new page to appear on the menu under the List Person's page link.

What is the best practice in Roo to create this new page?

Do I create a new method on the controller?

How do I get the JSP generated?

How do I get this new page to be picked up by the menu.jspx?

Thanks in advanced. Georgi

A: 

Hello,

I have created a sample app for you. Download the latest spring roo instalation and run these commands.

project --topLevelPackage com.stackoverflow.personapp --projectName personapp

persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY

entity --class ~.domain.Person --testAutomatically

field string --fieldName name --notNull

field boolean --fieldName graduated --notNull

controller all --package ~.web

finder add --class com.stackoverflow.personapp.domain.Person --finderName findPeopleByGraduated

quit

Then type mvn clean install jetty:run

Go to your browser and localhost:8080 you will see the app

Shekhar
This worked well! Only tweak I would have liked is for the new page to list all the nonGraduated Persons not a serach form where I chose true or false.Thanks for the detalied reply.
nerdgerl
If you like the answer ..please vote!!
Shekhar