Difference between Spring MVC and Spring Core
These are very broad questions and I will try to simplify them.
Is Spring core used in Spring MVC? How is Spring Core used in Spring MVC?
Yes, Spring MVC uses the core Spring. First of all, Spring's core is an IOC container that injects dependencies into various bean classes (like your controller classes, service classes, etc.). So spring-mvc uses the power of the IOC container (spring-core) to set up web infrastructure components like WebApplicationContext
and allow / create objects ViewResolver
, etc.
I suggest you take a look here for a detailed understanding of how Spring modules work together with each other.
Are Spring MVC and Struts MVC the same? and in Spring MVC is it only view layer like struts MVC?
They both bear little resemblance as they follow the FrontController pattern, i.e. Spring uses DispatcherServlet
and Struts uses ActionServlet
. But Spring offers a lot more configurations using different components (like adapters, handlers, etc.) Inside a web application, for example, you can easily configure what content to consume / produce from controllers. You can take a look here on this for a detailed explanation of the differences between both of these structures.
source to share