This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between struts 1.x and 2.x

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you give me sample code for that difference.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k fine. i will try to understand
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For struts2x public class ListBlogsAction extends ActionSupport implements ServletRequestAware {}
For struts1x public class RemoveBlogEntryAction extends Action.
Is it k
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess--I'm not really sure what you're trying to do, though.
 
Nidhi Garg
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic