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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With