Spring 4 MVC Controllers Part I

Topics 

  • What is a Controller? 
  • Request mapping 
  • Handler method arguments - Implicit models 
  • Handler method return types (for view selection)

What is a Controller?

What does a Controller do? 

  • Controller has a set of handlers (handler methods) 
    • A HTTP request is mapped to a handler of a controller 
  • Controllers handles HTTP requests 
    • Controller receives user input and transforms it into a model 
    • Controller performs business logic and then and set attributes (key/value pairs) of the model 
  • Typically a controller delegates business logic processing to a set of services 
    • The services in turn access database through DAO interface (or Repository interface)

 

Download Course Contents