I am reading about Java MVC web frameworks. There are a lot of them, but I am focusing on Spring vs. Struts because those two seem to be the most popular. I don’t want to use one of those new ones that use a weird dialect of Java such as Grails, Groovy, etc. I want legit Java here.
From what I am reading, Struts was created by Apache back in 2000. It is considered kind of the “grand-daddy” of all other Java web frameworks. It was very useful and good at the time, but people eventually felt it didn’t age well and was too rigid and had some design flaws. They re-did a lot of it and called it Struts 2.0, and that’s now the more commonly used version. It is still one of the top 2 or 3 frameworks. From what I am reading, it is much better than 1.0 and is a reasonable choice, but it is still kind of rigid and it gets a fair amount of its popularity from older web devs who learned Struts 1.0 and don’t want to re-learn a new (possibly better) framework.
Spring was created by some guys in around 2005-06 as a response to what they perceived as flaws in Struts and other frameworks. They put it out and wrote a book about how to use it, which sold a bunch of copies. Both frameworks are under active development (both released a new minor upgrade version in the last few days). Spring is currently on v3.x.
Some features people like in Spring are that it integrates better with POJOs (Plain Old Java Objects), which apparently Struts isn’t as good at (it prefers Java Beans, which I’ve never really understood the point of). Also Spring is designed to work well with the Hibernate ORM framework, which I also really want to learn. I’m reading that people are saying that it’s easier to write testing code against Spring based on its design (can’t really find details about exactly why this is so). Also Spring has some things called “dependency injection” and “aspect-oriented design” which are apparently good but sound like douche buzzwords to me.
There aren’t a ton of great pages comparing them, but here’s one where most of the commenters strongly advocate for Spring. They say it is simpler and less rigid and easier to understand and so on.
Here is a site listing 12 major benefits of Spring over Struts:
Conclusion: It seems like Spring is the way to go…?