Ankeet's backend garden

@Component

  • can be put on a class and then it means [spring] will manage its lifecycle

    • creation, death etc
  • @Controller is a specialized form of @Component wherein it associates a Model and a ViewResolver with it

    • Model gives the data to the ViewResolver - usual server side rendered applications
    • ViewResolver can be anything I presume - JSP, JSON
  • @Controller can be mixed with @ResponseBody to send json to caller, otherwise as per this book it sends both (model + view)

Untitled-2021-03-04-0015.png

Referred in

@Component