Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Difference between Struts and Spring

Choose Subjects for getting difference ⇒ Refresh this page
Struts is a sophisticated framework offering the easy 2 develop, structured view/presentation layer of the MVC applications. Advanced, robust and scalable view framework underpinning reuse and seperation of concerns to certain extent.Springs is a Lightweight Inversion of Control and Aspect Oriented Container Framework. Every work in the last sentence carry the true purpose of the Spring framework. It is just not a framework to integrate / plug in at the presentation layer. It is much more to that. It is adaptible and easy to run light weight applications, it provides a framework to integrate OR mapping, JDBC etc., Infact Struts can be used as the presentation tier in Spring.
Struts features strictly associate with presentation stuff. It offers Tiles to bring in reuse at presentation level. It offers Modules allowing the application presentation to segregate into various modules giving more modularity there by allowing each module to have its own Custom/Default Request Processor.Spring provides Aspect Oriented programming, it also solves the seperation of concerns at a much bigger level. It allows the programmer to add the features (transactions, security, database connectivity components, logging components) etc., at the declaration level. Spring framework takes the responsibility of supplying the input parameters required for the method contracts at runtime reducing the coupling between various modules by a method called dependency injection / Inversion of Control.
Struts is developed with a Front Controller and dispatcher pattern. Where in all the requests go to the ActionServlet thereby routed to the module specific Request Processor which then loads the associated Form Beans, perform validations and then handovers the control to the appropriate Action class with the help of the action mapping specified in Struts-config.xml file.Spring does not route the request in a specific way like this, rather it allows to you to design in your own way however in allowing to exploit the power of framework, it allows you to use the Aspect Oriented Programming and Inversion of Control in a great way with great deal of declarative programming with the XML. Commons framework can be integrated to leverage the validation in spring framework too. Morethan this, it provides all features like JDBC connectivity, OR Mapping etc., just to develop & run your applications on the top of this.
Struts 2 integrates with Dojo AJAX framework closely and provides many complex UI components out-of-box, such as datepicker, tooltips, etc.Spring is not.
Struts 2 has AJAX theme.Spring has not.
Struts 2 tags are stylesheet-driven, making it easier to develop consistent pages.Spring is not.
Struts 2 checkboxes are stateful, and require no special handling.Spring is not.
Struts is mainly a presentation layer framework, like redirecting to a particular page ,doing client side validations etc which otherwise very tedious using jsp and servlets.Spring is a complete J2EE framework having seven independent layers which can be used all together or few layers integrated with some other framework. Spring provides declarative transaction management and AOP. One layer of spring is for presentation purpose like struts but for only presentation layer, struts is better than spring.
If you want a bunch of taglibs that generate form fields and so forth, Struts is probably the better choice.Whereas Spring is not in this area.
Our UI is mostly click-driven and light on data and validation. It seems to me that most people run into difficulties with Struts when they start moving a lot of data from HTTP into the model.In Spring this problem does not exist.
Is it helpful? Yes No
Get differences from below
JSF vs JSPJSP vs ServletsJSP vs ASP
JSF 1.2 vs JSF 2.0JSF 2.0 vs JSF 2.1Java 5 vs Java 6
Java 6 vs Java 6 update 10Java 6 vs Java 7Java 6 update 10 vs Java 6 update 12
Java 1.0 vs Java 1.1Java 1.1 vs Java 1.2Java 1.2 vs Java 1.3
Java 1.3 vs Java 1.4Java 1.4 vs Java 5Struts 1 vs Struts 2
Struts 1.1 vs Struts 1.2Struts 1.2 vs Struts 1.3Linux vs Unix
C vs C++Java vs C++Java vs J2EE
Struts vs JSFStruts vs SpringApache vs IIS
Jboss vs TomcatJboss vs WebLogicJavaScript vs Jquery
JavaScript vs VBScriptJquery vs AngularJSHTML vs XML
Java 7 vs Java 8EJB 2.0 vs EJB 3.0EJB 3.0 vs Spring
JDBC vs HibernateJDBC vs JPAJDBC 3.0 vs JDBC 4.0
CSS 2 vs CSS 3EJB 1.0 vs EJB 2.0AWT vs Swing
Swing vs AppletPHP vs JSPJ2EE vs J2ME
Java 8 vs Java 9MVC 1 vs MVC 2Hibernate 3 vs Hibernate 4
Spring 3.0 vs Spring 4.0jQuery Mobile vs BootstrapJavaBeans vs EJB
JSON vs XMLRESTful Web Services vs SOAP Web ServicesSpring 2.5 vs Spring 3.0
HTTP vs HTTPSAngularJS vs NodeJS
©2016 WithoutBook