Technology Programming

Java Spring Vs. Struts

    Spring

    • According to Spring framework reference documentation, Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications. It became popular and gained wide adoption in the software industry as a less intrusive and efficient framework that provides dependency injection and inversion of control. It also has a set of other facilities such as transaction management, Aspect Oriented Programming, database connection control and many more. The framework is easily configurable to load only the modules required by an application.

    Apache Struts

    • Apache Struts is a Java web application framework that provides a Model-View-Controller (MVC) pattern to streamline web applications built using Java Server Pages and Servlets. Struts framework gained popularity as a way to have a standardized way for building web-based applications based on the MVC architecture. Compared with Spring, Apache Struts provides a narrower set of facilities for building web-based applications.

    Spring Web MVC vs Apache Struts

    • A component of Spring known as Spring Web MVC provides comparable features as Apache Struts. Apache Struts is a good option if a MVC architecture support is all that's needed. Spring Web MVC makes sense if the application being developed also needs other facilities that are provided by Spring. If required, Struts has mechanisms for hooking up dependency injection frameworks such as Spring into a web-based application.

    Tag Libraries and AJAX Support

    • The later versions of both the frameworks are able to support AJAX and JSON. Apache struts also includes a set of tag libraries that provide pre-built User Interface components such as menus and layouts. Spring Web MVC also provides a set of Spring tag library that provide support for data binding and themes. The later versions of both the frameworks also provide mechanism to support REST.

    Spring Web Flow

    • Another Spring component that can be considered in web application development is Spring Web Flow. It is an extension that provides a mechanism to define and control flows, which are a set of related user interactions. Compared with Spring MVC and Struts, where a user interaction is typically one request and response, WebFlow provides a richer way to provide web user interactions.



Leave a reply