aspose file tools*
The moose likes Struts and the fly likes difference between struts 1.x  and 2.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "difference between struts 1.x  and 2.x" Watch "difference between struts 1.x  and 2.x" New topic
Author

difference between struts 1.x and 2.x

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
I can understand the following : difference between struts 1x and 2.x. can you explain it into single line
Action classes

Struts1 extends the abstract base class by its action class. The problem with struts1 is that it uses the abstract classes rather than interfaces.

While in Struts 2, an Action class implements an Action interface, along with other interfaces use optional and custom services. Struts 2 provides a base ActionSupport class that implements commonly used interfaces. Although an Action interface is not necessary, any POJO object along with an execute signature can be used as an Struts 2 Action object.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Rajendra Prakash wrote:difference between struts 1x and 2.x. can you explain it into single line

Not really; they're completely, entirely different frameworks that work very differently.

I have a one-liner, relatively short answer that doesn't require any framework-specific words--maybe if you think about what problem(s) your description above solves your one line will be closer to mine--give it a shot.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
can you give me sample code for that difference.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
k fine. i will try to understand
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The request doesn't make any sense to me--it's not a code answer, it's a one-line, no framework-specific words that tries to summarize the (many, many) differences between Struts 1 and Struts 2, which is what I thought your original post was discussing.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
For struts2x public class ListBlogsAction extends ActionSupport implements ServletRequestAware {}
For struts1x public class RemoveBlogEntryAction extends Action.
Is it k
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I guess--I'm not really sure what you're trying to do, though.
Nidhi Garg
Greenhorn

Joined: Jun 19, 2009
Posts: 21
Some of the differences are as follows:

-Struts 2 has intelligent default configurations
-Struts 2 has JAVA POJO approach unlike struts1.2
-Struts 2 has no separate action form class
-Struts 2 uses both xml configuration and annotations for mapping
-Struts 2 has interceptors which leads to reduced coupling
-Struts 2 execute method returns a String. In Struts 1 execute method returns ActionForward object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between struts 1.x and 2.x