O'Reilly logo

Spring Roo 1.1 Cookbook by Ashish Sarin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manually creating a Spring MVC controller for a JPA entity

If you want to create a custom controller, then Roo offers a controller class command that creates the skeleton structure of a controller and a JSPX view to let you quickly get started.

Let's consider that in our flight-app application we have the following entities:

  • Customer: Represents a customer in the flight booking application
  • Address: Represents the address of the customer

For the sake of simplicity, let's assume that there is a one-to-one bidirectional relationship between Customer and Address entities, the Customer being the owner of the relationship. The Customer entity has only one field: the customerName and the Address entity has two fields: addressLine1 and addressLine2.

Let's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required