Spring framework is a lightweight framework because of its POJO implementation. The spring class does not inherit another class or implement another interface. So it is a non-invasive. For example, struts class is extended to Action class but spring class does not implement any interface.
Spring applications are loose coupling because spring applications defined in Dependency Injection.
Spring’s web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks such as Struts or web frameworks.
Spring framework provides templates for JDBC(Java Database Connectivity), Hibernate, JPA (Java Persistence API)etc. If we use the predefined templates then don’t write the large code in your application. For example if we defined one JDBC template on that time we don’t open any connection object or don’t create the statement object, committing a transaction, closing connection etc. If we import only for a predefined package, that package is given spring framework.
Spring framework support dependency injection then we develop J2EE applications very easily.
It provides declarative support for caching, validations, transactions and formatting.
Spring provides a consistent transaction management interface that can scale down to a local transaction (Using a single database) and scale up to global transactions (using JTA).
Spring framework does not depend on any server like EJB.
After wiring the above code the window should become like below.
Now run the application, to do that, we have to click F5. Then we should get new window like below: