File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts 1 VS Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 VS Struts 2" Watch "Struts 1 VS Struts 2" New topic

Struts 1 VS Struts 2

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 219
Hi ranchers,

Strus1 Vs Struts 2

The above URL tells about struts 1 vs struts 2.

First difference i did not get...

It is given "Struts 1 requires Action classes to extend an abstract base class. A common problem in Struts 1 is programming to abstract classes instead of interfaces"

I never coded by extending abstract classes. ActionServlet , Action, ActionForm etc are not abstract classes.. why did the person mention abstract classes , i don't get it.

Do any of ranchers have any explanation for this.

Thanks BVR.

Vipul Kumar
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

vipul bondugula wrote:
Do any of ranchers have any explanation for this.

I can't explain why they used the term "abstract". Suffice to say, Struts 1 requires an action class to extend Action. Struts 2 allows one to use any POJO.

[How To Ask Questions On JavaRanch]
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 219
Thanks for your reply Joe.

In the apache site also they did mention the same. They simply don't use the term abstract. There must be some explanation..

why do they mislead us...

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

IMHO Struts 1.2 is class driven but the framework should be an interface driven(according to the proper design) so that we can extend some other classes

Struts 2.0 is interface driven we can write without using interface or with interface or with a class

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
I agree. Here's the link:
subject: Struts 1 VS Struts 2
It's not a secret anymore!