Current location - Music Encyclopedia - Chinese History - What's the difference between Spring and SpringMVC?
What's the difference between Spring and SpringMVC?
The difference between Spring and SpringMVC

1, Spring is an open source framework to solve enterprise application development. Simply put, Spring is a lightweight container framework that controls inversion (IoC) and aspect-oriented (AOP). Spring can configure and combine simple components into complex applications. In Spring, application objects are combined declaratively, usually in an XML file.

Spring also provides many basic functions (transaction management, persistence framework integration and so on). ), the development of application logic is left to you. Spring enables you to write clearer, easier to manage and easier to test code.

They also provide basic support for various modules in Spring. AOP and IOC, the two cores of Spring, can be used independently for any application, including integration with MVC frameworks such as Struts and ORM frameworks such as Hibernate. At present, many companies use Spring+Struts(2)+Hibernate for so-called lightweight development.

2.Spring MVC is an MVC framework, and the development of Spring MVC annotations is more convenient than Struts2, which can directly replace the above Struts (of course, Struts, as a very mature MVC, feels a little better in function than Spring, but Spring MVC is enough).

Spring mvc is more efficient than struts, because the value stack of struts affects efficiency. Spring MVC is similar to an MVC open framework of struts, but both belong to Spring. Spring MVC needs the support of Spring's shelf package to run.

3.Spring is the container framework of IOC and AOP, and SpringMVC is the Web framework based on Spring function. If you want to use SpringMVC, you must first rely on Spring. SpringMVC can be compared to Struts. ?

Spring is the container framework of IOC and AOP, and SpringMVC is the Web framework based on Spring function. If you want to use SpringMVC, you must first rely on Spring. ?

Spring can be said to be a container for managing bean, and it can also be said to be a general term that contains many open source projects. Spring mvc is one of the open source projects, so if you simply go through a process, when an http request arrives, the container (such as tomact) parses the http into a request, finds a distributor of spring mvc through the mapping relationship (path, method and parameters) to process the request, and then finds tomcat in a pool (bean container) of spring managed beans, and returns the response after processing.

SpringMVC is a WEB development framework with MVC pattern.

Spring is a general solution, and its biggest purpose is to reduce the complexity of software through Ioc/AOP decoupling, so Spring can be used with many other solutions, such as SpringMVC, not just for WEB development.

Song Seung Heon:?

SSH is an integrated framework of struts+spring+hibernate and a popular open source framework for JAVA Web applications.