This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Struts and the fly likes PlugIn  interface in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "PlugIn  interface in struts" Watch "PlugIn  interface in struts" New topic

PlugIn interface in struts

Amirtharaj Chinnaraj
Ranch Hand

Joined: Sep 28, 2006
Posts: 241
hi guys
iam having some doubts in org.apache.struts.action.PlugIn

we are having a class that implements this Plugin interface

that has 3 methods apart from init() and destory()(totally 5 methods)

i was not able to figure out when and where these methods are

called i thought that these 3 methods will be callback methods

looking for your replies

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The only methods that Struts will call on your plugin are init() and destroy(). If you have other methods, the only way they will get called is if you locate the object and call them yourself. For example, you could make the object a singleton and provide it with a static getInstance() method that returns an instance of the class. Once you have a reference to the object, you can call whatever methods you want.

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: PlugIn interface in struts
It's not a secret anymore!