*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 in action Book question" Watch "Struts 2 in action Book question" New topic
Author

Struts 2 in action Book question

BGirish Bapat
Greenhorn

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.
-
Girish
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
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: http://jnassef.blogspot.com/
devarshm
Greenhorn

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
Author
Greenhorn

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
 
Don't get me started about those stupid light bulbs.
 
subject: Struts 2 in action Book question
 
Similar Threads
Struts2
Struts2
Struts2
Struts2
struts2