Struts2 vs Spring 3

Does anyone know the difference between Struts2 and Spring 3 MVC. I know the difference between Struts 1 and Spring 2.5, but what advantage does Struts2 have over Spring 3 or otherwise.

I have tried looking all over the internet but there is no comprehensive answer.

+46
java spring spring-mvc struts2
Feb 25 '11 at 23:23
source share
8 answers

Struts2 is truly WebWork 2, renamed Struts2. Think for a moment of the fact that Struts essentially used his own brand to take WebWork as his new base, and this should offer you that there are at least those who consider it very convincing: you are not always throw them away to create their own code base to start over when they release the sequel.

However, I will not tell you that Struts2 is better / worse than Spring 3 MVC. The bottom line is that they are definitely comparable.

If you would like more detailed information on how they are compared, I suggest you familiarize yourself with Matt Raiff’s presentations in recent years on this topic:

http://raibledesigns.com/rd/entry/my_comparing_jvm_web_frameworks

http://static.raibledesigns.com/repository/presentations/ComparingJavaWebFrameworks-ApacheConUS2007.pdf

including a spreadsheet that compares several of them to varying degrees:

http://spreadsheets.google.com/pub?key=0AtkkDCT2WDMXdC1HOEtnUHpCejJMbUhGeGJWUmh5dVE&hl=en&output=html

+26
Feb 26 '11 at 7:45
source share

Well, both Struts2 and Spring3 are very similar in many ways. This is an action-oriented framework and much more in the stream. Spring MVC came out due to all the known limitations of Struts1. but when you come to choose Struts2 vs Spring3 MVC, you cannot distinguish, and both of them are well designed and good. for Struts2 as the basis for working with websites, but with a lot of improvements over webwork.one, the main advantage is UI tag support for Struts2 relative to spring3 mvc, its equally good and powerful positive side is its good and very deep integration with Spring framework.

We use Struts2 with Spring DI and transcription management in our few projects, and in some using Spring MVC. it matters only for your choice and for your brand.

change

In my opinion, it’s not a good practice to compare how a structure is developed, think up your requirements, what are the requirements of your project, rather than analysis, in which the framework program provides the best and very similar requirements according to your needs, and does not simple comparison

+16
Feb 26 2018-11-11T00:
source share

FEATURES OF COMPARISON

Struts 2

  • Configurable MVC components that are stored in the struts.xml file. If you want to change something, you can easily do this in an XML file.

  • Actions based on POJO. The Struts 2 action class is a plain old Java object that prevents developers from implementing any interface or inheriting from any class.

  • Ajax support, which is used to create an asynchronous request. It sends the necessary field data, and does not provide unnecessary information, which in the end improves performance.

  • Support integration with Hibernate, Spring, Tiles, etc.

  • If you want to use JSP, freemarker, speed or something else, you can use different types of results in Struts 2.

  • You can also use various tags, such as user interface tags, data tags, control tags, etc.

  • Provides broad theme and template support. Struts 2 supports three different types of themes, including xhtml, simple, and css_xhtml.

Spring mvc

  • Clear and clear separation of roles. Whether it is a controller, a command object, a form object, or anything else, this can easily be done using a specialized object.

  • Using flexibility, non-intrusiveness and flexibility with the signature of the controller method.

  • Now use existing business objects as a command or form object, rather than duplicate them to extend the base class of the database.

  • Customizable binding and validation will allow you to manually analyze and transform business objects, rather than using a regular string.

  • Flexible mode transmission makes it easy to integrate with the latest technology.

  • Customizable language and theme definition, JSP support with or without Spring Tag Library for JSTL, etc.

  • Leverage from simle, but a powerful JSP tag library known as the Spring Tag Library. It provides support for various functions, such as data bindings and themes.




    ADVANTAGES OF COMPARISON

Struts 2

  • Simplified design

  • Easy to use plugin

  • Simplified ActionForm and Annotations

  • Better tag features

  • OGNL Integration

  • AJAX Support

Spring mvc

  • A clear separation between controllers, JavaBeans models, and views that is not possible with Struts.

  • Spring MVC is more flexible than Struts.

  • Spring can be used with various platforms such as Velocity, XLST or various other viewing technologies.

  • In Spring, there is nothing like ActionForm, but it binds directly to domain objects.

  • The code is also more verified than Struts.

  • This is a complete J2EE structure consisting of seven independent layers, which simplifies integration with other frames.

  • It does not provide a framework for implementing a business domain and logic, which helps developers create a controller and presentation for the application.

(Source http://www.cygnet-infotech.com/blog/struts-2-vs-springmvc )

+6
Jun 06 '15 at 11:52
source share

I would respond in a weary way since I did not use spring MVC much.

Use struts2 for

1)struts2 tags and 2)struts 2 plugins and 3)struts2 plugin framework using freemarker makes struts2-jquery-plugin and config-browser-plugin 

The struts 2 convention allows you to create an action class without even annotations and zero configuration in xml. Its just to make it look good on paper, however in all real large projects you will need to write annotations. If you are lost among the annotations at runtime, there is a way to find out the configuration in the browser in dev mode, try config-browser-plugin.

Remember Struts / spring MVC consists of a very small part of the web application only to the front controller.

+3
Jul 04 2018-12-12T00:
source share

Do not be bitten, but if you should spend your time considering the choice of a framework, then it is also worth spending your time to stand on a few spikes against you, the most important passwords of high-level user stories. Both Struts2 and Spring MVC 3 are very easy to set up demos, i.e. You can get the maven archetype from your development environment in less than 5 minutes.

I participated in panel discussions about which structure is better, and I sincerely believe that no discussion is worth the time. You are much better off working with wireframes in the context of your use cases.

+2
Dec 09 '13 at 17:25
source share

If you know the difference between rows 1 and spring 2.5, ask yourself what is the difference between racks 1 and 2 and spring 2.5 and 3, respectively. In the latter case, webmvc refinement with validation, xml sorting, rest, etc. See What's New in Spring 3.0 , for struts, see What's New in Struts 2.0 .

+1
Feb 25 2018-11-23T00:
source share

As Umesh said, the positive side of spring3 MVC is that it has deep integration with Spring. In one of my projects, I used the proprietary DI framework, so Struts2 was the obvious choice (we didn't want the two DI frameworks together)

Struts2 is a mature and widely used web map with very active community support. Spring3 is a great framework with many modules, including spring mvc.

+1
May 17 '12 at 19:59
source share

Struts 2 has been affected by a number of security vulnerabilities over the past two years, and this fact should be considered. http://www.cvedetails.com/product/6117/Apache-Struts.html?vendor_id=45

http://www.cvedetails.com/vendor/9664/Springsource.html

0
May 01 '14 at 18:45
source share



All Articles