Difference between Spring MVC and Spring Core

Are Spring MVC and Struts MVC the same? and in Spring MVC is it only presentation layer like struts MVC? Spring core is used in Spring MVC. could you please tell us how Spring Core is used in Spring MVC.

+3


source to share


1 answer


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.

+1


source







All Articles