This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes apache2 and extends Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "apache2 and extends" Watch "apache2 and extends" New topic

apache2 and extends

Glenn Timchishen

Joined: Jun 20, 2004
Posts: 21

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

Joined: Oct 29, 2001
Posts: 8839

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.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: apache2 and extends
Similar Threads
doPost in struts2
struts2 action-method-validation.xml not working?
Static content caching problem in Struts2
Struts2 problem with if tag inside iterator