To be used by the users, the Domain Classes have to be used by the controllers that form the application layer. This layer coordinates and interprets the commands given on the User Interface (UI), which is the HTML pages seen by the final user.
Now we will see some controllers that are part of the UI.
CustomerController
lets the customer interact with the store. The names of the methods of the Controller are:
Create
: To perform creation of a new ordersave
: To save the ordershow
: To show the customer detailsorder
: To show the content of the orderitems
: To show the items contained in the orderremove
: To remove an item from the order
The controller is built through Spring MVC annotation. The class is marked as controller with the @Controller
annotation with the name customerController
. Each method is marked with @RequestMapping
to assign the HTTP URL used to call the method on the controller.
Every method returns a ModelAndView
object that contains...