File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to inherit a class in Action class

 
samir ware
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
I come across the problem of inheriting the class in an Action class.
As per the struts frame work implementation the actoin class implemaenation should be as follows


class DbAction extends Action {
execute();
}

that means my action class(DbAction) should inherit the Action class. But what if I want to extend one more class in DbAction.
for eg . suppose I have a class DataBase that has the methods for connecting to database, releasing the connection ,firing any queary etc. and all these methodes are PROTECTED.
so in order to access these methodes I should extend the class DataBase in DbAction . But my DbAction already extends Action and its not possible to extend more than two classes in java.
So how shouls I proceed.
Plzzzzzzzzzz let me know the solution for the same.
Thanks in advance,
Samir

 
vidya sagar
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi samir

Have a model class which extends ur Db class.

Then make a call from ur action class to your model class
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic