• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

apache2 and extends

 
Glenn Timchishen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In my research regarding struts2 I was lead to believe that struts2 did most of its work through implmenting interfaces (like springMVC) and not through extends. However when I look through examples on the web, all I see is, extends, extends, extends.

So whats the real story? Was my original research incorrect? Is struts2 still dependant on extending superclasses in order to get it's work done?

Please advise?
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the API doc for com.opensymphony.xwork2.Action:
All actions may implement this interface, which exposes the execute() method. However, as of XWork 1.1, this is not required and is only here to assist users. You are free to create POJOs that honor the same contract defined by this interface without actually implementing the interface.

It doesn't look like you need to implement or extend anything (haven't tried it).
I assume the examples you are finding extend ActionSupport?
That's a good base class to start because it covers a lot of the basic functionality for most actions (creating action/error messages, retrieving messages by key, validation and so on), which may account for its popularity.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic