Struts and spring both are used to develop Java web applications. Struts were developed earlier than Spring but with enhancements in the Struts framework, both are used nowadays to develop web applications using Java.
Modular, portable and testable Java applications can be formed using open-source spring framework. It is a standard for developing web apps and can be used over J2EE aka Java to Enterprise Edition applications. This handles the infrastructure and makes the codes reusable and testable thereby enhancing their performance. It works on an inversion of control IoC and dependency injection concept. It is also used to decrease the coupling between the modules of the program.
Spring Framework Architecture
Struts is a framework based on MVC architecture that stands for model view and Controller architecture. It is an open-source platform and is used to develop enterprise edition web applications. It has a request handler and response handler because it is based on request-based Framework which handles the request from the user. AJAX, REST and SOAP are supported by Struts.
Working of Struts:
Difference between Spring and Struts architecture
|It is a lightweight framework.||It is a heavyweight framework.|
|It does not support tag library.||It supports tag library directive.|
|It has loosely coupled modules.||It has tightly coupled programming modules.|
|It is integrated with ORM Technologies using which, lesser coding is required after and before the main logic.||It supports manual coding.|
|It has a layered MVC architecture containing 3 layers for modelling, viewing and controller.||It does not have a layered architecture.|
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Spring Boot | How to access database using Spring Data JPA
- Spring MVC using Java based configuration
- Bean life cycle in Java Spring
- How to create a REST API using Java Spring Boot
- Singleton and Prototype Bean Scopes in Java Spring
- How to create a basic application in Java Spring Boot
- Containerizing Java applications | Creating a Spring Boot App using Dockerfile
- Introduction and Working of Struts Web Framework
- Spring Dependency Injection with Example
- Introduction to Spring Framework
- Introduction to Spring Boot
- Introduction to the Spring Data Framework
- Aspect Oriented Programming and AOP in Spring Framework
- How to encrypt passwords in a Spring Boot project using Jasypt
- Spring Boot | How to consume JSON messages using Apache Kafka
- Spring Boot | How to publish String messages on Apache Kafka
- Spring Boot | How to publish JSON messages on Apache Kafka
- Spring Boot | How to consume string messages using Apache Kafka
- Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java
- Java.util.BitSet class methods in Java with Examples | Set 2
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.