Could s.b. who has experience with Java Struts and rails
One of the first differences is one of kind. Rails has an answer for
all three letters in MVC. Struts is squarely focused on providing the
C. In Rails, that layer is handled by Action Controller (part of Action
Pack which also includes Action View).
A few other quick differences:
* All actions in Struts must be mapped in an XML file. All return
values use indirection (SUCCESS/FAILURE) that must be mapped in the XML
file. In Action Controller, this is all handled by reflection (the
framework figures out how the configuration should look).
* Action Controller cares deeply about Pretty URLs, such as
/customers/show/154. It's baked right into the framework. Default
Struts exposes technology in the URLs (*.do) and generally doesn't work
hard to care for the beauty of the URL. (Third-party add-ons can
alleviate that to some degree).
* Struts' actions are full-fledged classes, actions in AC are just
methods. The default number of lines for an action in Basecamp[1] is 5.
Look at any struts example and find any action. It's not even funny.
* Action Controller supports the concept of layouts natively. Struts
requires the aid of Tiles, which in turn requires its own set of XML
files for configuration (on top of what's already required in Struts).
* Validation in Struts requires the use of "model mirrors" called
ActionForms. These mirrors have a 1-1 mapping to your model files a lot
of the time, but uses a different syntax. This means you're Repeating
Yourself. In Rails, validation is pushed to the model, while the
_presentation_ of validation errors are kept in the Action Controller.
* Action Controller has deep support for filters/interceptors (running
shared code before and after all actions). Struts have a research
project called SAIF to get this type of support, but nothing in the
main framework.
* Action Controller has scaffolding to quickly bring a model class
"online" (provide CRUD operations without doing code).
...and then of course, Action Controller is built with a whole MVC
framework in mind. So it works exceedingly well Action View and Active
Record. There's definitely preferential treatment going on there, even
if Action Controller is a separate framework.
I hope that helped a bit. Have in mind that I'm pretty biased, though
. Struts personifies much of my animosity towards the Java/J2EE
world. It has XML-files up to here, duplication and repetition coming
out of the wazoo, and very little to show for it when it's done.
What I _do_ like about Struts is how it some how got positioned itself
as the default controller in the majority of run-of-the-mill J2EE apps.
That's a freaking awesome piece of PR work there. I'm still learning on
that account
[1] Basecamp was the first application to use Rails. It's a web-based
project management tool available at
http://www.basecamphq.com.
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://macromates.com/ -- TextMate: Code and markup editor for OS
X
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services