This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 in action Book question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 in action Book question" Watch "Struts 2 in action Book question" New topic

Struts 2 in action Book question

BGirish Bapat

Joined: Aug 04, 2005
Posts: 3
Hi Authors,
1. What are main advantages of struts2 over struts.
2. Why one should migrate / integrate his current running struts to struts2
and what are simple ways to do so.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 471

The main advantages are:
1- Actions are POJOs, so they aren't coupled with any framework or container
2- Actions are not coupled with servlet API, so they are easily unit tested

A full comparison between struts 1.x and struts 2.x is available here. You can also take a look at the migration guide.

Visit my blog:

Joined: Sep 18, 2003
Posts: 1
The main reason I think are:
1. testing methodology
2. that it uses OGNL (Object Graph Notation Language) and valuestack technology
chad michael davis

Joined: Mar 01, 2006
Posts: 27
The other folks have already pointed out several of the big improvements found in Struts 2, like POJO actions and decoupling of actions from Servlet API.

I would add that, in general, the entire framework demonstrates a cleaner architecture. Struts 2 is a very good case study in software engineering principles. All of the components in Struts 2 are cleanly separated from each other allowing, among many other things, easy testing of all framework components.

You can customize and add your own versions of all framework components with very little effort. For instance, the UI Component tags that come bundled with Struts 2 can be customized easily and cleanly. If you need the oupput of the bundled form tag to be in a different format or use different styling, you can easily customize the component to do what you need. The same holds true for even core components like the ObjectFactory that instantiates the actions and interceptors. The Spring plugin takes advantage of this to override the core objectfactory with one that looks for spring beans when its trying to come up with a given framework component.

So, I would say that a clean, highly flexible architecture is the hallmark of the new struts

Chad Davis<br />Co-author of Struts 2 in Action
I agree. Here's the link:
subject: Struts 2 in action Book question
It's not a secret anymore!