Search code examples
javarestspring-mvcspring-restcontrollerspring-rest

Need some clarification on Spring Configuration and Initializer


I have been following this tutorial to build my Spring REST API for a project.

http://websystique.com/springmvc/spring-4-mvc-rest-service-example-using-restcontroller/

Now, I have a question. Do i have to create <class_name>Configuration and <class_name>Initializer class for every rest controller that I am going to make ?


Solution

  • The answer is no. Configuration and Initializer classes are application context wide. Those are just another way of configuring the Spring application context (the other is using xml configuration files)