Difference between Spring MVC and Spring Core
Asked Answered
M

1

8

Are Spring MVC and Struts MVC are alike? and in Spring MVC is it only presentation layer like struts MVC? Does Spring core is used in Spring MVC. could you please elaborate on how Spring Core is used in Spring MVC.

Mayapple answered 4/4, 2017 at 17:38 Comment(2)
Please check here : docs.spring.io/spring/docs/current/spring-framework-reference/…Franciscofranciska
Thanks for the linkMayapple
V
6

Those are very broad questions and I will try to put them in simple terms.

Does Spring core is used in Spring MVC? How Spring Core is used in Spring MVC?

Yes, Spring MVC uses Spring core. First of all, Spring core is an IOC container which injects the dependencies into various bean classes (like your controller classes, Service classes, etc..). So, spring-mvc leverages the power of the IOC container (spring-core) to set up the web framework components like WebApplicationContext and resolving/creating ViewResolver objects, etc..

I suggest you can look here for a detailed understanding of how spring modules collaboratively work with each other.

Are Spring MVC and Struts MVC are alike? and in Spring MVC is it only presentation layer like struts MVC?

They both have few similarities like they follow FrontController pattern i.e., Spring uses DispatcherServlet and Struts uses ActionServlet. But spring offers much more configurations by using various components (like adapters, handlers, etc..) inside the web application, for example, you can easily configure which content needs to be consumed/produced from controllers. You can look here on this for a detailed explanation on the differences between both of these frameworks.

Vanna answered 4/4, 2017 at 18:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.