Struts vs JSF vs Spring
In this tutorial, we are going to discuss Differences between Struts, JSF and Spring (Struts vs JSF vs Spring).
1. Struts and JSF are web frameworks, which we will provide an excellent environment to prepare and execute web applications only.
Spring Framework is an application framework. It will provide an excellent environment to prepare and execute all applications like standalone applications, web applications, distributed applications.
2. Struts and JSF are designed based on the MVC design pattern.
In Spring, only WEB Module is designed based on the MVC design pattern. Spring uses several other design patterns like IOC [Dependency Injection], Locater design patterns, Creational Design Patterns, Decorator Design pattern.
3. Struts is a controller layered framework. It has an excellent focus on the controller layer in MVC.
JSF is a view layered Framework. It has an excellent focus on the View layer in MVC. Spring Framework has provided excellent support for all Controller Layer, Model Layer, and View Layer.
4. In Enterprise Application Development, Struts and JSF are used to prepare mainly the Presentation layer.
In Enterprise Application Development, Spring Framework will cover all the layers like Presentation Layer, Business Layer, Persistence Layer.
5. Struts and JSF provide support for the basic services like I18N, Validations, Exception Handling, etc. but, Struts and JSF are not providing support for the middleware services like JAAS, JNDI, JTA, Java Mail, JMS etc.
Spring Framework provides very good support for all basic services like I18N, Validations, Exception Handling … and the Middleware services like JAAS, JNDI, JTA, Java Mail, JMS, JCA, etc.
6. Struts and JSF have not modularized Frameworks. To prepare any application in Struts and JSF, we have to load all the jar files irrespective of their utilization.
Spring framework is a modularized framework. To prepare applications in the spring framework, we will load only the module respective jar files, not unnecessarily load other modules respective jar files.
7. Struts and JSF are more API dependent; they are not having POJO/POJI kind of implementations.
Spring is less API-dependent. It has POJO/POJI kind of implementations.
8. Due to the above reasons, debugging and testing is difficult in Struts and JSF.
Testing and Debugging are very simple in the Spring framework.
9. Struts and JSF are heavy-weight Frameworks.
Spring is a lightweight Framework.
10. Struts and JSF are not providing any predefined support to integrate the other applications like JDBC, EJB, Hibernate, JPA, RMI, etc.
Spring has provided excellent predefined support to integrate the other applications like JDBC, EJB, Hibernate, JPA, RMI, etc.
11. Struts and JSF allow the basic view-related technologies like Html, JSP, etc., to prepare the view part.
Spring Framework allows the most advanced view-related technologies like Velocity, Free marker, etc., and basic view-related tech to prepare view part.
12. Struts and JSF do not have Aspect-Oriented Programming to prepare applications.
Spring has provided excellent Aspect-Oriented Programming to prepare Applications.