

Ask YC: Spring and Struts2 - kashif

I wanted to better appreciate the design choices that go with choosing Spring over Struts2 or the other way around. If you have used any of these Java frameworks please share your thought on them.
======
jm4
I've used Spring but not Spring MVC so I can't comment on their web framework.
I have used WebWork which became Struts 2. I think Java web development is
complicated and tedious under the best of circumstances, but as far as Java
web frameworks are concerned WebWork/Struts2 is decent.

You're going to have lots of files. You're going to have at least several
hundred lines of XML even for a small application. This is par for the course
in the Java world. The upside is that the documentation available is generally
very good and it's also very easy to navigate your way around the application.
Another plus is that Struts is kind of the de facto standard framework for
many Java developers so it's easy to find help.

You might also want to check out Stripes if you like Struts2. I like to think
of it as a better Struts2. It follows more of a convention over configuration
model while still being at least as flexible as Struts2. The result is less
code, faster development and no XML. It also has the benefit of being so
similar to Struts that any developer familiar with one can quickly pick up the
other.

Wicket is interesting too and probably worth a look. There was also a
framework called RIFE that looked like it had potential, but the documentation
was absolutely atrocious when I looked at it about a year ago.

------
jlouis
I've done things in Spring but not the MVC parts. The problem is that
configuration is in XML and untyped. So that means your bugs will show up
runtime. This, combined with the long make-edit-build-deploy cycles for most
Java code severely hampers you. Guice is much better as the injection is being
typed and many bugs can be removed early on. On the other hand, you then need
to search for a Web framework.

